From 6c7174beeeb838820cafd741de12cdd034628e1f Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 11:01:57 -0700 Subject: [PATCH 01/18] first pass at workflow configs --- .../actions/determine_exclusions/action.yml | 4 +- .../process_test_conditions/action.yml | 69 +++++++++++++++++++ .github/workflows/get_and_run_tests.yml | 17 ++--- .github/workflows/run_test.yml | 4 +- .github/workflows/test.yml | 46 +++++++++---- 5 files changed, 109 insertions(+), 31 deletions(-) create mode 100644 .github/actions/process_test_conditions/action.yml diff --git a/.github/actions/determine_exclusions/action.yml b/.github/actions/determine_exclusions/action.yml index bb9835a64e..9e63097f83 100644 --- a/.github/actions/determine_exclusions/action.yml +++ b/.github/actions/determine_exclusions/action.yml @@ -3,7 +3,7 @@ description: 'Determines which tests should be excluded based on workflow trigge inputs: is_workflow_dispatch: - description: 'Whether this is a workflow dispatch run' + description: 'Whether this is a workflow dispatch event' required: true exclude_slow_input: description: 'Workflow dispatch input for excluding slow tests' @@ -12,7 +12,7 @@ inputs: description: 'Workflow dispatch input for excluding unstable tests' required: true exclude_release_only_input: - description: 'Workflow dispatch input for excluding release only tests' + description: 'Workflow dispatch input for excluding release-only tests' required: true is_feature_branch_draft_pr: description: 'Whether this is a draft PR' diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml new file mode 100644 index 0000000000..9304910140 --- /dev/null +++ b/.github/actions/process_test_conditions/action.yml @@ -0,0 +1,69 @@ +name: 'Process Test Conditions' +description: 'Process all test-related conditions and inputs to determine final test configuration' + +inputs: + is_workflow_dispatch: + description: 'Whether this is a workflow dispatch event' + required: true + exclude_slow_input: + description: 'Workflow dispatch input for excluding slow tests' + required: true + exclude_unstable_input: + description: 'Workflow dispatch input for excluding unstable tests' + required: true + exclude_release_only_input: + description: 'Workflow dispatch input for excluding release-only tests' + required: true + fuzz_input: + description: 'Workflow dispatch input for running fuzz tests' + required: false + default: 'false' + +outputs: + exclude_slow: + description: 'Whether to exclude slow tests' + value: ${{ steps.process-conditions.outputs.exclude_slow }} + exclude_unstable: + description: 'Whether to exclude unstable tests' + value: ${{ steps.process-conditions.outputs.exclude_unstable }} + exclude_release_only: + description: 'Whether to exclude release-only tests' + value: ${{ steps.process-conditions.outputs.exclude_release_only }} + link_azle: + description: 'Whether to link to the development version of azle' + value: ${{ steps.process-conditions.outputs.link_azle }} + fuzz: + description: 'Whether to run fuzz tests' + value: ${{ steps.process-conditions.outputs.fuzz }} + +runs: + using: 'composite' + steps: + - id: set-conditions + uses: ./.github/actions/set_run_conditions + + - id: process-conditions + shell: bash + run: | + if [[ "${{ inputs.is_workflow_dispatch }}" == "true" ]]; then + echo "exclude_slow=${{ inputs.exclude_slow_input }}" >> $GITHUB_OUTPUT + echo "exclude_unstable=${{ inputs.exclude_unstable_input }}" >> $GITHUB_OUTPUT + echo "exclude_release_only=${{ inputs.exclude_release_only_input }}" >> $GITHUB_OUTPUT + echo "link_azle=${{ inputs.link_azle_input }}" >> $GITHUB_OUTPUT + echo "fuzz=${{ inputs.fuzz_input }}" >> $GITHUB_OUTPUT + else + exclude_slow=${{ inputs.is_feature_branch_draft_pr }} + exclude_unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} + exclude_release_only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} + + echo "exclude_slow=$exclude_slow" >> $GITHUB_OUTPUT + echo "exclude_unstable=$exclude_unstable" >> $GITHUB_OUTPUT + echo "exclude_release_only=$exclude_release_only" >> $GITHUB_OUTPUT + if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ + "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then + echo "include_npm=true" >> $GITHUB_OUTPUT + else + echo "include_npm=false" >> $GITHUB_OUTPUT + fi + echo "fuzz=false" >> $GITHUB_OUTPUT + fi diff --git a/.github/workflows/get_and_run_tests.yml b/.github/workflows/get_and_run_tests.yml index ca0dea9d45..69ff2ef95d 100644 --- a/.github/workflows/get_and_run_tests.yml +++ b/.github/workflows/get_and_run_tests.yml @@ -18,6 +18,9 @@ on: required: false type: boolean default: false + link_azle: + required: true + type: boolean jobs: prepare-test-environment: @@ -25,24 +28,14 @@ jobs: runs-on: ubuntu-latest outputs: test-infos: ${{ steps.get-test-infos.outputs.test-infos }} - include_npm: ${{ steps.set-include-npm.outputs.include_npm }} steps: - uses: actions/checkout@v4 + - id: get-test-infos uses: ./.github/actions/get_test_infos with: directories: ${{ inputs.directories }} exclude-dirs: ${{ inputs.exclude-dirs }} - - uses: ./.github/actions/set_run_conditions - id: set-conditions - - id: set-include-npm - run: | - if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ - "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then - echo "include_npm=true" >> $GITHUB_OUTPUT - else - echo "include_npm=false" >> $GITHUB_OUTPUT - fi run-tests: name: 'Run' @@ -50,6 +43,6 @@ jobs: uses: ./.github/workflows/run_test.yml with: test_infos: ${{ needs.prepare-test-environment.outputs.test-infos }} - include_npm: ${{ needs.prepare-test-environment.outputs.include_npm == 'true' }} + link_azle: ${{ inputs.link_azle }} run_experimental: ${{ inputs.run_experimental }} fuzz: ${{ inputs.fuzz }} diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 962ae0a009..4110f622c2 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -6,7 +6,7 @@ on: test_infos: required: true type: string - include_npm: + link_azle: required: true type: boolean run_experimental: @@ -46,7 +46,7 @@ jobs: # os: [macos-latest, ubuntu-latest] os: [ubuntu-latest] azle_source: - - ${{ inputs.include_npm == true && 'npm' || 'repo' }} + - ${{ inputs.link_azle == true && 'repo' || 'npm' }} test: ${{ fromJSON(inputs.test_infos) }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bd013cf62..0f4dfaf73a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,40 +37,55 @@ on: required: true type: boolean default: true + link-azle: + description: 'Link to development version of azle' + required: true + type: boolean + default: true jobs: - get-exclude-dirs: - name: Get exclude directories + process-conditions: + name: Process test conditions runs-on: ubuntu-latest outputs: - exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }} + exclude_slow: ${{ steps.process-conditions.outputs.exclude_slow }} + exclude_unstable: ${{ steps.process-conditions.outputs.exclude_unstable }} + exclude_release_only: ${{ steps.process-conditions.outputs.exclude_release_only }} + link_azle: ${{ steps.process-conditions.outputs.link_azle }} + fuzz: ${{ steps.process-conditions.outputs.fuzz }} steps: - uses: actions/checkout@v4 - - id: set-conditions - uses: ./.github/actions/set_run_conditions - - - id: determine-exclusions - uses: ./.github/actions/determine_exclusions + - id: process-conditions + uses: ./.github/actions/process_test_conditions with: is_workflow_dispatch: ${{ github.event_name == 'workflow_dispatch' }} exclude_slow_input: ${{ inputs.exclude-slow-tests }} exclude_unstable_input: ${{ inputs.exclude-unstable-tests }} exclude_release_only_input: ${{ inputs.exclude-release-only-tests }} - is_feature_branch_draft_pr: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }} - is_feature_branch_pr: ${{ steps.set-conditions.outputs.is_feature_branch_pr }} - is_main_branch_push: ${{ steps.set-conditions.outputs.is_main_branch_push }} + link_azle_input: ${{ inputs.link-azle }} + fuzz_input: ${{ inputs.fuzz }} + + get-exclude-dirs: + name: Get exclude directories + needs: process-conditions + runs-on: ubuntu-latest + outputs: + exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }} + steps: + - uses: actions/checkout@v4 - id: get-exclude-dirs uses: ./.github/actions/get_exclude_dirs with: - exclude-slow: ${{ steps.determine-exclusions.outputs.exclude_slow }} - exclude-unstable: ${{ steps.determine-exclusions.outputs.exclude_unstable }} - exclude-release-only: ${{ steps.determine-exclusions.outputs.exclude_release_only }} + exclude-slow: ${{ needs.process-conditions.outputs.exclude_slow }} + exclude-unstable: ${{ needs.process-conditions.outputs.exclude_unstable }} + exclude-release-only: ${{ needs.process-conditions.outputs.exclude_release_only }} run-tests: name: ${{ matrix.test_group.name }} needs: + - process-conditions - get-exclude-dirs strategy: fail-fast: false @@ -126,7 +141,8 @@ jobs: directories: ${{ matrix.test_group.directories }} exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} run_experimental: ${{ matrix.test_group.run_experimental || false }} - fuzz: ${{ inputs.fuzz || false }} + fuzz: ${{ needs.process-conditions.outputs.fuzz }} + link_azle: ${{ needs.process-conditions.outputs.link_azle }} check-test-success: name: Check Azle tests succeeded From 4862c25fc7ce92b3ad18582db15e58368f0845c9 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:38:39 -0700 Subject: [PATCH 02/18] make variable case consistent --- .../actions/determine_exclusions/README.md | 14 +++--- .../actions/determine_exclusions/action.yml | 40 +++++++-------- .../process_test_conditions/action.yml | 50 +++++++++---------- .github/workflows/get_and_run_tests.yml | 8 +-- .github/workflows/run_test.yml | 8 +-- .github/workflows/test.yml | 38 +++++++------- 6 files changed, 79 insertions(+), 79 deletions(-) diff --git a/.github/actions/determine_exclusions/README.md b/.github/actions/determine_exclusions/README.md index 94bd3935ab..bcdb1a2868 100644 --- a/.github/actions/determine_exclusions/README.md +++ b/.github/actions/determine_exclusions/README.md @@ -7,17 +7,17 @@ steps: - id: determine-exclusions uses: ./.github/actions/determine_exclusions with: - is_workflow_dispatch: ${{ github.event_name == 'workflow_dispatch' }} - exclude_slow_input: ${{ inputs.exclude-slow-tests }} - exclude_unstable_input: ${{ inputs.exclude-unstable-tests }} - exclude_release_only_input: ${{ inputs.exclude-release-only-tests }} + is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} + exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} + exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} + exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} is_feature_branch_draft_pr: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }} is_feature_branch_pr: ${{ steps.set-conditions.outputs.is_feature_branch_pr }} is_main_branch_push: ${{ steps.set-conditions.outputs.is_main_branch_push }} - name: Use exclusion outputs run: | - echo "Exclude slow tests: ${{ steps.determine-exclusions.outputs.exclude_slow }}" - echo "Exclude unstable tests: ${{ steps.determine-exclusions.outputs.exclude_unstable }}" - echo "Exclude release only tests: ${{ steps.determine-exclusions.outputs.exclude_release_only }}" + echo "Exclude slow tests: ${{ steps.determine-exclusions.outputs.exclude-slow }}" + echo "Exclude unstable tests: ${{ steps.determine-exclusions.outputs.exclude-unstable }}" + echo "Exclude release only tests: ${{ steps.determine-exclusions.outputs.exclude-release-only }}" ``` diff --git a/.github/actions/determine_exclusions/action.yml b/.github/actions/determine_exclusions/action.yml index 9e63097f83..5822c462a7 100644 --- a/.github/actions/determine_exclusions/action.yml +++ b/.github/actions/determine_exclusions/action.yml @@ -2,16 +2,16 @@ name: 'Determine Test Exclusions' description: 'Determines which tests should be excluded based on workflow trigger and conditions' inputs: - is_workflow_dispatch: + is-workflow-dispatch: description: 'Whether this is a workflow dispatch event' required: true - exclude_slow_input: + exclude-slow-dispatch-input-value: description: 'Workflow dispatch input for excluding slow tests' required: true - exclude_unstable_input: + exclude-unstable-dispatch-input-value: description: 'Workflow dispatch input for excluding unstable tests' required: true - exclude_release_only_input: + exclude-release-only-dispatch-input-value: description: 'Workflow dispatch input for excluding release-only tests' required: true is_feature_branch_draft_pr: @@ -25,15 +25,15 @@ inputs: required: true outputs: - exclude_slow: + exclude-slow: description: 'Whether to exclude slow tests' - value: ${{ steps.determine.outputs.exclude_slow }} - exclude_unstable: + value: ${{ steps.determine.outputs.exclude-slow }} + exclude-unstable: description: 'Whether to exclude unstable tests' - value: ${{ steps.determine.outputs.exclude_unstable }} - exclude_release_only: + value: ${{ steps.determine.outputs.exclude-unstable }} + exclude-release-only: description: 'Whether to exclude release only tests' - value: ${{ steps.determine.outputs.exclude_release_only }} + value: ${{ steps.determine.outputs.exclude-release-only }} runs: using: 'composite' @@ -41,16 +41,16 @@ runs: - id: determine shell: bash run: | - if [[ "${{ inputs.is_workflow_dispatch }}" == "true" ]]; then - echo "exclude_slow=${{ inputs.exclude_slow_input }}" >> $GITHUB_OUTPUT - echo "exclude_unstable=${{ inputs.exclude_unstable_input }}" >> $GITHUB_OUTPUT - echo "exclude_release_only=${{ inputs.exclude_release_only_input }}" >> $GITHUB_OUTPUT + if [[ "${{ inputs.is-workflow-dispatch }}" == "true" ]]; then + echo "exclude-slow=${{ inputs.exclude-slow-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "exclude-unstable=${{ inputs.exclude-unstable-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "exclude-release-only=${{ inputs.exclude-release-only-dispatch-input-value }}" >> $GITHUB_OUTPUT else - exclude_slow=${{ inputs.is_feature_branch_draft_pr }} - exclude_unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} - exclude_release_only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} + exclude-slow=${{ inputs.is_feature_branch_draft_pr }} + exclude-unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} + exclude-release-only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} - echo "exclude_slow=$exclude_slow" >> $GITHUB_OUTPUT - echo "exclude_unstable=$exclude_unstable" >> $GITHUB_OUTPUT - echo "exclude_release_only=$exclude_release_only" >> $GITHUB_OUTPUT + echo "exclude-slow=$exclude-slow" >> $GITHUB_OUTPUT + echo "exclude-unstable=$exclude-unstable" >> $GITHUB_OUTPUT + echo "exclude-release-only=$exclude-release-only" >> $GITHUB_OUTPUT fi diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 9304910140..f7f4ae2177 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -2,36 +2,36 @@ name: 'Process Test Conditions' description: 'Process all test-related conditions and inputs to determine final test configuration' inputs: - is_workflow_dispatch: + is-workflow-dispatch: description: 'Whether this is a workflow dispatch event' required: true - exclude_slow_input: + exclude-slow-dispatch-input-value: description: 'Workflow dispatch input for excluding slow tests' required: true - exclude_unstable_input: + exclude-unstable-dispatch-input-value: description: 'Workflow dispatch input for excluding unstable tests' required: true - exclude_release_only_input: + exclude-release-only-dispatch-input-value: description: 'Workflow dispatch input for excluding release-only tests' required: true - fuzz_input: + fuzz-dispatch-input-value: description: 'Workflow dispatch input for running fuzz tests' required: false default: 'false' outputs: - exclude_slow: + exclude-slow: description: 'Whether to exclude slow tests' - value: ${{ steps.process-conditions.outputs.exclude_slow }} - exclude_unstable: + value: ${{ steps.process-conditions.outputs.exclude-slow }} + exclude-unstable: description: 'Whether to exclude unstable tests' - value: ${{ steps.process-conditions.outputs.exclude_unstable }} - exclude_release_only: + value: ${{ steps.process-conditions.outputs.exclude-unstable }} + exclude-release-only: description: 'Whether to exclude release-only tests' - value: ${{ steps.process-conditions.outputs.exclude_release_only }} - link_azle: + value: ${{ steps.process-conditions.outputs.exclude-release-only }} + link-azle: description: 'Whether to link to the development version of azle' - value: ${{ steps.process-conditions.outputs.link_azle }} + value: ${{ steps.process-conditions.outputs.link-azle }} fuzz: description: 'Whether to run fuzz tests' value: ${{ steps.process-conditions.outputs.fuzz }} @@ -45,20 +45,20 @@ runs: - id: process-conditions shell: bash run: | - if [[ "${{ inputs.is_workflow_dispatch }}" == "true" ]]; then - echo "exclude_slow=${{ inputs.exclude_slow_input }}" >> $GITHUB_OUTPUT - echo "exclude_unstable=${{ inputs.exclude_unstable_input }}" >> $GITHUB_OUTPUT - echo "exclude_release_only=${{ inputs.exclude_release_only_input }}" >> $GITHUB_OUTPUT - echo "link_azle=${{ inputs.link_azle_input }}" >> $GITHUB_OUTPUT - echo "fuzz=${{ inputs.fuzz_input }}" >> $GITHUB_OUTPUT + if [[ "${{ inputs.is-workflow-dispatch }}" == "true" ]]; then + echo "exclude-slow=${{ inputs.exclude-slow-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "exclude-unstable=${{ inputs.exclude-unstable-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "exclude-release-only=${{ inputs.exclude-release-only-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT + echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - exclude_slow=${{ inputs.is_feature_branch_draft_pr }} - exclude_unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} - exclude_release_only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} + exclude-slow=${{ inputs.is_feature_branch_draft_pr }} + exclude-unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} + exclude-release-only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} - echo "exclude_slow=$exclude_slow" >> $GITHUB_OUTPUT - echo "exclude_unstable=$exclude_unstable" >> $GITHUB_OUTPUT - echo "exclude_release_only=$exclude_release_only" >> $GITHUB_OUTPUT + echo "exclude-slow=$exclude-slow" >> $GITHUB_OUTPUT + echo "exclude-unstable=$exclude-unstable" >> $GITHUB_OUTPUT + echo "exclude-release-only=$exclude-release-only" >> $GITHUB_OUTPUT if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then echo "include_npm=true" >> $GITHUB_OUTPUT diff --git a/.github/workflows/get_and_run_tests.yml b/.github/workflows/get_and_run_tests.yml index 69ff2ef95d..450f9764cc 100644 --- a/.github/workflows/get_and_run_tests.yml +++ b/.github/workflows/get_and_run_tests.yml @@ -10,7 +10,7 @@ on: required: false type: string default: '' - run_experimental: + run-experimental: required: false type: boolean default: false @@ -18,7 +18,7 @@ on: required: false type: boolean default: false - link_azle: + link-azle: required: true type: boolean @@ -43,6 +43,6 @@ jobs: uses: ./.github/workflows/run_test.yml with: test_infos: ${{ needs.prepare-test-environment.outputs.test-infos }} - link_azle: ${{ inputs.link_azle }} - run_experimental: ${{ inputs.run_experimental }} + link-azle: ${{ inputs.link-azle }} + run-experimental: ${{ inputs.run-experimental }} fuzz: ${{ inputs.fuzz }} diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 4110f622c2..22c1d2b384 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -6,10 +6,10 @@ on: test_infos: required: true type: string - link_azle: + link-azle: required: true type: boolean - run_experimental: + run-experimental: required: false type: boolean default: false @@ -46,7 +46,7 @@ jobs: # os: [macos-latest, ubuntu-latest] os: [ubuntu-latest] azle_source: - - ${{ inputs.link_azle == true && 'repo' || 'npm' }} + - ${{ inputs.link-azle == true && 'repo' || 'npm' }} test: ${{ fromJSON(inputs.test_infos) }} steps: - uses: actions/checkout@v4 @@ -151,6 +151,6 @@ jobs: env: AZLE_PROPTEST_NUM_RUNS: ${{ steps.calc-runs.outputs.runs }} AZLE_PROPTEST_VERBOSE: true - AZLE_EXPERIMENTAL: ${{ inputs.run_experimental }} + AZLE_EXPERIMENTAL: ${{ inputs.run-experimental }} AZLE_FUZZ: ${{ inputs.fuzz }} AZLE_FUZZ_CALL_DELAY: ${{ inputs.call-delay }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f4dfaf73a..01ab6d2390 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,10 +48,10 @@ jobs: name: Process test conditions runs-on: ubuntu-latest outputs: - exclude_slow: ${{ steps.process-conditions.outputs.exclude_slow }} - exclude_unstable: ${{ steps.process-conditions.outputs.exclude_unstable }} - exclude_release_only: ${{ steps.process-conditions.outputs.exclude_release_only }} - link_azle: ${{ steps.process-conditions.outputs.link_azle }} + exclude-slow: ${{ steps.process-conditions.outputs.exclude-slow }} + exclude-unstable: ${{ steps.process-conditions.outputs.exclude-unstable }} + exclude-release-only: ${{ steps.process-conditions.outputs.exclude-release-only }} + link-azle: ${{ steps.process-conditions.outputs.link-azle }} fuzz: ${{ steps.process-conditions.outputs.fuzz }} steps: - uses: actions/checkout@v4 @@ -59,12 +59,12 @@ jobs: - id: process-conditions uses: ./.github/actions/process_test_conditions with: - is_workflow_dispatch: ${{ github.event_name == 'workflow_dispatch' }} - exclude_slow_input: ${{ inputs.exclude-slow-tests }} - exclude_unstable_input: ${{ inputs.exclude-unstable-tests }} - exclude_release_only_input: ${{ inputs.exclude-release-only-tests }} - link_azle_input: ${{ inputs.link-azle }} - fuzz_input: ${{ inputs.fuzz }} + is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} + exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} + exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} + exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} + link-azle-dispatch-input-value: ${{ inputs.link-azle }} + fuzz-dispatch-input-value: ${{ inputs.fuzz }} get-exclude-dirs: name: Get exclude directories @@ -78,9 +78,9 @@ jobs: - id: get-exclude-dirs uses: ./.github/actions/get_exclude_dirs with: - exclude-slow: ${{ needs.process-conditions.outputs.exclude_slow }} - exclude-unstable: ${{ needs.process-conditions.outputs.exclude_unstable }} - exclude-release-only: ${{ needs.process-conditions.outputs.exclude_release_only }} + exclude-slow: ${{ needs.process-conditions.outputs.exclude-slow }} + exclude-unstable: ${{ needs.process-conditions.outputs.exclude-unstable }} + exclude-release-only: ${{ needs.process-conditions.outputs.exclude-release-only }} run-tests: name: ${{ matrix.test_group.name }} @@ -95,7 +95,7 @@ jobs: - { name: 'Examples (Experimental)', directories: './examples', - run_experimental: true + run-experimental: true } - { name: 'E2E Class', @@ -104,7 +104,7 @@ jobs: - { name: 'E2E Class (Experimental)', directories: './tests/end_to_end/candid_rpc/class_syntax', - run_experimental: true + run-experimental: true } - { name: 'E2E Functional', @@ -121,7 +121,7 @@ jobs: - { name: 'Property Class (Experimental)', directories: './tests/property/candid_rpc/class_api', - run_experimental: true + run-experimental: true } - { name: 'Property Functional', @@ -134,15 +134,15 @@ jobs: - { name: 'Property IC API (Experimental)', directories: './tests/property/ic_api', - run_experimental: true + run-experimental: true } uses: ./.github/workflows/get_and_run_tests.yml with: directories: ${{ matrix.test_group.directories }} exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} - run_experimental: ${{ matrix.test_group.run_experimental || false }} + run-experimental: ${{ matrix.test_group.run-experimental || false }} fuzz: ${{ needs.process-conditions.outputs.fuzz }} - link_azle: ${{ needs.process-conditions.outputs.link_azle }} + link-azle: ${{ needs.process-conditions.outputs.link-azle }} check-test-success: name: Check Azle tests succeeded From 72b0284ed6bf21c3181a815f74619a1b37e4a8dd Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:41:01 -0700 Subject: [PATCH 03/18] add test log --- .github/actions/process_test_conditions/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index f7f4ae2177..3cb548cd4e 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -67,3 +67,14 @@ runs: fi echo "fuzz=false" >> $GITHUB_OUTPUT fi + + - id: echo-outputs + shell: bash + run: | + echo "=== Test Conditions Outputs ===" + echo "exclude-slow: ${{ steps.process-conditions.outputs.exclude-slow }}" + echo "exclude-unstable: ${{ steps.process-conditions.outputs.exclude-unstable }}" + echo "exclude-release-only: ${{ steps.process-conditions.outputs.exclude-release-only }}" + echo "link-azle: ${{ steps.process-conditions.outputs.link-azle }}" + echo "fuzz: ${{ steps.process-conditions.outputs.fuzz }}" + echo "===========================" From bae4a3bba6c3cc2e3afb9975c025ffabdccfba05 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:42:42 -0700 Subject: [PATCH 04/18] add link azle dispatch input value --- .github/actions/process_test_conditions/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 3cb548cd4e..83a8fd5db1 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -18,6 +18,9 @@ inputs: description: 'Workflow dispatch input for running fuzz tests' required: false default: 'false' + link-azle-dispatch-input-value: + description: 'Workflow dispatch input for linking to the development version of azle' + required: true outputs: exclude-slow: From 5efd82f22f18778812172e5cfaa5a59173891e59 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:44:59 -0700 Subject: [PATCH 05/18] make bash variable UPPER_CASE --- .github/actions/process_test_conditions/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 83a8fd5db1..7945b5f021 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -55,13 +55,13 @@ runs: echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - exclude-slow=${{ inputs.is_feature_branch_draft_pr }} - exclude-unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} - exclude-release-only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} + EXCLUDE_SLOW=${{ inputs.is_feature_branch_draft_pr }} + EXCLUDE_UNSTABLE=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} + EXCLUDE_RELEASE_ONLY=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} - echo "exclude-slow=$exclude-slow" >> $GITHUB_OUTPUT - echo "exclude-unstable=$exclude-unstable" >> $GITHUB_OUTPUT - echo "exclude-release-only=$exclude-release-only" >> $GITHUB_OUTPUT + echo "exclude-slow=$EXCLUDE_SLOW" >> $GITHUB_OUTPUT + echo "exclude-unstable=$EXCLUDE_UNSTABLE" >> $GITHUB_OUTPUT + echo "exclude-release-only=$EXCLUDE_RELEASE_ONLY" >> $GITHUB_OUTPUT if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then echo "include_npm=true" >> $GITHUB_OUTPUT From e64ee83e01f9b2d25db26b8bc71baef07c625493 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:46:26 -0700 Subject: [PATCH 06/18] fix typo --- .github/actions/process_test_conditions/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 7945b5f021..4a87e4f567 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -64,9 +64,9 @@ runs: echo "exclude-release-only=$EXCLUDE_RELEASE_ONLY" >> $GITHUB_OUTPUT if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then - echo "include_npm=true" >> $GITHUB_OUTPUT + echo "link-azle=true" >> $GITHUB_OUTPUT else - echo "include_npm=false" >> $GITHUB_OUTPUT + echo "link-azle=false" >> $GITHUB_OUTPUT fi echo "fuzz=false" >> $GITHUB_OUTPUT fi From 479eba9c7ea1c8e3c5f3dbae04f177a385117026 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:47:06 -0700 Subject: [PATCH 07/18] add explicit check for true --- .github/actions/process_test_conditions/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 4a87e4f567..20a719bc91 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -55,7 +55,7 @@ runs: echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - EXCLUDE_SLOW=${{ inputs.is_feature_branch_draft_pr }} + EXCLUDE_SLOW=${{ inputs.is_feature_branch_draft_pr == 'true' }} EXCLUDE_UNSTABLE=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} EXCLUDE_RELEASE_ONLY=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} From af6f7204e5064dbb4cc02d6e49a79db793fe12f6 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:49:02 -0700 Subject: [PATCH 08/18] use the outputs from set-conditions --- .github/actions/process_test_conditions/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 20a719bc91..5bf8291c61 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -55,9 +55,9 @@ runs: echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - EXCLUDE_SLOW=${{ inputs.is_feature_branch_draft_pr == 'true' }} - EXCLUDE_UNSTABLE=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} - EXCLUDE_RELEASE_ONLY=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} + EXCLUDE_SLOW=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' }} + EXCLUDE_UNSTABLE=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_pr == 'true' }} + EXCLUDE_RELEASE_ONLY=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_main_branch_push == 'true' }} echo "exclude-slow=$EXCLUDE_SLOW" >> $GITHUB_OUTPUT echo "exclude-unstable=$EXCLUDE_UNSTABLE" >> $GITHUB_OUTPUT From f7b093152dad329f2ff31756a7373bd140807465 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:52:31 -0700 Subject: [PATCH 09/18] add default --- .github/workflows/get_and_run_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/get_and_run_tests.yml b/.github/workflows/get_and_run_tests.yml index 450f9764cc..0be6c4f486 100644 --- a/.github/workflows/get_and_run_tests.yml +++ b/.github/workflows/get_and_run_tests.yml @@ -21,6 +21,7 @@ on: link-azle: required: true type: boolean + default: false jobs: prepare-test-environment: From ef15fc7d409e8fe48156aa17c2bf03e059fb9b4a Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 12:54:34 -0700 Subject: [PATCH 10/18] invert value since name was inverted --- .github/actions/process_test_conditions/action.yml | 12 ++++++------ .github/workflows/test.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 5bf8291c61..7bd694f129 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -62,12 +62,12 @@ runs: echo "exclude-slow=$EXCLUDE_SLOW" >> $GITHUB_OUTPUT echo "exclude-unstable=$EXCLUDE_UNSTABLE" >> $GITHUB_OUTPUT echo "exclude-release-only=$EXCLUDE_RELEASE_ONLY" >> $GITHUB_OUTPUT - if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ - "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then - echo "link-azle=true" >> $GITHUB_OUTPUT - else - echo "link-azle=false" >> $GITHUB_OUTPUT - fi + if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ + "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then + echo "link-azle=false" >> $GITHUB_OUTPUT + else + echo "link-azle=true" >> $GITHUB_OUTPUT + fi echo "fuzz=false" >> $GITHUB_OUTPUT fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01ab6d2390..ec89c37e28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,8 +141,8 @@ jobs: directories: ${{ matrix.test_group.directories }} exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} run-experimental: ${{ matrix.test_group.run-experimental || false }} - fuzz: ${{ needs.process-conditions.outputs.fuzz }} - link-azle: ${{ needs.process-conditions.outputs.link-azle }} + fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} + link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} check-test-success: name: Check Azle tests succeeded From 85497420057058b7916fa4e1a6056ec7a3436fe6 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 13:17:47 -0700 Subject: [PATCH 11/18] clean up actions --- .../actions/determine_exclusions/README.md | 23 -------- .../actions/determine_exclusions/action.yml | 56 ------------------- .../actions/process_test_conditions/README.md | 24 ++++++++ 3 files changed, 24 insertions(+), 79 deletions(-) delete mode 100644 .github/actions/determine_exclusions/README.md delete mode 100644 .github/actions/determine_exclusions/action.yml create mode 100644 .github/actions/process_test_conditions/README.md diff --git a/.github/actions/determine_exclusions/README.md b/.github/actions/determine_exclusions/README.md deleted file mode 100644 index bcdb1a2868..0000000000 --- a/.github/actions/determine_exclusions/README.md +++ /dev/null @@ -1,23 +0,0 @@ -## Example Usage - -```yaml -steps: - - uses: actions/checkout@v4 - - - id: determine-exclusions - uses: ./.github/actions/determine_exclusions - with: - is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} - exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} - exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} - exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} - is_feature_branch_draft_pr: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }} - is_feature_branch_pr: ${{ steps.set-conditions.outputs.is_feature_branch_pr }} - is_main_branch_push: ${{ steps.set-conditions.outputs.is_main_branch_push }} - - - name: Use exclusion outputs - run: | - echo "Exclude slow tests: ${{ steps.determine-exclusions.outputs.exclude-slow }}" - echo "Exclude unstable tests: ${{ steps.determine-exclusions.outputs.exclude-unstable }}" - echo "Exclude release only tests: ${{ steps.determine-exclusions.outputs.exclude-release-only }}" -``` diff --git a/.github/actions/determine_exclusions/action.yml b/.github/actions/determine_exclusions/action.yml deleted file mode 100644 index 5822c462a7..0000000000 --- a/.github/actions/determine_exclusions/action.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: 'Determine Test Exclusions' -description: 'Determines which tests should be excluded based on workflow trigger and conditions' - -inputs: - is-workflow-dispatch: - description: 'Whether this is a workflow dispatch event' - required: true - exclude-slow-dispatch-input-value: - description: 'Workflow dispatch input for excluding slow tests' - required: true - exclude-unstable-dispatch-input-value: - description: 'Workflow dispatch input for excluding unstable tests' - required: true - exclude-release-only-dispatch-input-value: - description: 'Workflow dispatch input for excluding release-only tests' - required: true - is_feature_branch_draft_pr: - description: 'Whether this is a draft PR' - required: true - is_feature_branch_pr: - description: 'Whether this is a feature branch PR' - required: true - is_main_branch_push: - description: 'Whether this is a push to main' - required: true - -outputs: - exclude-slow: - description: 'Whether to exclude slow tests' - value: ${{ steps.determine.outputs.exclude-slow }} - exclude-unstable: - description: 'Whether to exclude unstable tests' - value: ${{ steps.determine.outputs.exclude-unstable }} - exclude-release-only: - description: 'Whether to exclude release only tests' - value: ${{ steps.determine.outputs.exclude-release-only }} - -runs: - using: 'composite' - steps: - - id: determine - shell: bash - run: | - if [[ "${{ inputs.is-workflow-dispatch }}" == "true" ]]; then - echo "exclude-slow=${{ inputs.exclude-slow-dispatch-input-value }}" >> $GITHUB_OUTPUT - echo "exclude-unstable=${{ inputs.exclude-unstable-dispatch-input-value }}" >> $GITHUB_OUTPUT - echo "exclude-release-only=${{ inputs.exclude-release-only-dispatch-input-value }}" >> $GITHUB_OUTPUT - else - exclude-slow=${{ inputs.is_feature_branch_draft_pr }} - exclude-unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }} - exclude-release-only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }} - - echo "exclude-slow=$exclude-slow" >> $GITHUB_OUTPUT - echo "exclude-unstable=$exclude-unstable" >> $GITHUB_OUTPUT - echo "exclude-release-only=$exclude-release-only" >> $GITHUB_OUTPUT - fi diff --git a/.github/actions/process_test_conditions/README.md b/.github/actions/process_test_conditions/README.md new file mode 100644 index 0000000000..665f3e997f --- /dev/null +++ b/.github/actions/process_test_conditions/README.md @@ -0,0 +1,24 @@ +## Example Usage + +```yaml +steps: + - uses: actions/checkout@v4 + + - id: process-test-conditions + uses: ./.github/actions/process_test_conditions + with: + is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} + exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} + exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} + exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} + link-azle-dispatch-input-value: ${{ inputs.link-azle }} + fuzz-dispatch-input-value: ${{ inputs.fuzz-tests }} + + - name: Use process-test-conditions outputs + run: | + echo "Exclude slow tests: ${{ steps.process-test-conditions.outputs.exclude-slow }}" + echo "Exclude unstable tests: ${{ steps.process-test-conditions.outputs.exclude-unstable }}" + echo "Exclude release only tests: ${{ steps.process-test-conditions.outputs.exclude-release-only }}" + echo "Link to azle: ${{ steps.process-test-conditions.outputs.link-azle }}" + echo "Fuzz tests: ${{ steps.process-test-conditions.outputs.fuzz }}" +``` From d86b18f3d4e30c67fa97b0aa404c500329a68d54 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 13:24:20 -0700 Subject: [PATCH 12/18] attempt getting rid of middle man --- .github/workflows/get_and_run_tests.yml | 49 ------------------------- .github/workflows/test.yml | 23 ++++++++---- 2 files changed, 16 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/get_and_run_tests.yml diff --git a/.github/workflows/get_and_run_tests.yml b/.github/workflows/get_and_run_tests.yml deleted file mode 100644 index 0be6c4f486..0000000000 --- a/.github/workflows/get_and_run_tests.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Prepare and Run Tests - -on: - workflow_call: - inputs: - directories: - required: true - type: string - exclude-dirs: - required: false - type: string - default: '' - run-experimental: - required: false - type: boolean - default: false - fuzz: - required: false - type: boolean - default: false - link-azle: - required: true - type: boolean - default: false - -jobs: - prepare-test-environment: - name: 'Prepare Test Environment' - runs-on: ubuntu-latest - outputs: - test-infos: ${{ steps.get-test-infos.outputs.test-infos }} - steps: - - uses: actions/checkout@v4 - - - id: get-test-infos - uses: ./.github/actions/get_test_infos - with: - directories: ${{ inputs.directories }} - exclude-dirs: ${{ inputs.exclude-dirs }} - - run-tests: - name: 'Run' - needs: prepare-test-environment - uses: ./.github/workflows/run_test.yml - with: - test_infos: ${{ needs.prepare-test-environment.outputs.test-infos }} - link-azle: ${{ inputs.link-azle }} - run-experimental: ${{ inputs.run-experimental }} - fuzz: ${{ inputs.fuzz }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec89c37e28..cf220cd22b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,6 +84,7 @@ jobs: run-tests: name: ${{ matrix.test_group.name }} + runs-on: ubuntu-latest needs: - process-conditions - get-exclude-dirs @@ -136,13 +137,21 @@ jobs: directories: './tests/property/ic_api', run-experimental: true } - uses: ./.github/workflows/get_and_run_tests.yml - with: - directories: ${{ matrix.test_group.directories }} - exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} - run-experimental: ${{ matrix.test_group.run-experimental || false }} - fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} - link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} + steps: + - uses: actions/checkout@v4 + + - id: get-test-infos + uses: ./.github/actions/get_test_infos + with: + directories: ${{ matrix.test_group.directories }} + exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} + + - uses: ./.github/workflows/run_test.yml + with: + test_infos: ${{ steps.get-test-infos.outputs.test-infos }} + link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} + run-experimental: ${{ matrix.test_group.run-experimental || false }} + fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} check-test-success: name: Check Azle tests succeeded From 9560bddb33cf877f71fcfd6fbb4df51c2a8ea81e Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 13:33:55 -0700 Subject: [PATCH 13/18] use it better --- .github/workflows/run_test.yml | 22 ++++++++++++++++++++-- .github/workflows/test.yml | 23 +++++++---------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 22c1d2b384..e15fd9c88d 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -3,9 +3,13 @@ name: Run Test on: workflow_call: inputs: - test_infos: + directories: required: true type: string + exclude-dirs: + required: false + type: string + default: '' link-azle: required: true type: boolean @@ -27,8 +31,22 @@ on: default: 300 jobs: + get-test-infos: + runs-on: ubuntu-latest + outputs: + test-infos: ${{ steps.get-test-infos.outputs.test-infos }} + steps: + - uses: actions/checkout@v4 + + - id: get-test-infos + uses: ./.github/actions/get_test_infos + with: + directories: ${{ inputs.directories }} + exclude-dirs: ${{ inputs.exclude-dirs }} + run-test: name: '${{matrix.test.name}} | ${{matrix.test.displayPath}} | ${{matrix.azle_source}}' + needs: get-test-infos runs-on: ${{ matrix.os }} env: ETHEREUM_URL: ${{ secrets.ETHEREUM_URL }} @@ -47,7 +65,7 @@ jobs: os: [ubuntu-latest] azle_source: - ${{ inputs.link-azle == true && 'repo' || 'npm' }} - test: ${{ fromJSON(inputs.test_infos) }} + test: ${{ fromJSON(needs.get-test-infos.outputs.test-infos) }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf220cd22b..da12cbdc77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,6 @@ jobs: run-tests: name: ${{ matrix.test_group.name }} - runs-on: ubuntu-latest needs: - process-conditions - get-exclude-dirs @@ -137,21 +136,13 @@ jobs: directories: './tests/property/ic_api', run-experimental: true } - steps: - - uses: actions/checkout@v4 - - - id: get-test-infos - uses: ./.github/actions/get_test_infos - with: - directories: ${{ matrix.test_group.directories }} - exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} - - - uses: ./.github/workflows/run_test.yml - with: - test_infos: ${{ steps.get-test-infos.outputs.test-infos }} - link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} - run-experimental: ${{ matrix.test_group.run-experimental || false }} - fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} + uses: ./.github/workflows/run_test.yml + with: + directories: ${{ matrix.test_group.directories }} + exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} + link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} + run-experimental: ${{ matrix.test_group.run-experimental || false }} + fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} check-test-success: name: Check Azle tests succeeded From 9102643c6d376157568bc6659e66570766306336 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 14:08:46 -0700 Subject: [PATCH 14/18] naming clean up --- .../determine_workflow_context/README.md | 17 +++++++++++++++++ .../action.yml | 16 ++++++++-------- .../actions/process_test_conditions/action.yml | 2 +- .github/actions/set_run_conditions/README.md | 17 ----------------- .github/workflows/run_test.yml | 3 ++- .github/workflows/test.yml | 2 +- 6 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 .github/actions/determine_workflow_context/README.md rename .github/actions/{set_run_conditions => determine_workflow_context}/action.yml (77%) delete mode 100644 .github/actions/set_run_conditions/README.md diff --git a/.github/actions/determine_workflow_context/README.md b/.github/actions/determine_workflow_context/README.md new file mode 100644 index 0000000000..9b34723099 --- /dev/null +++ b/.github/actions/determine_workflow_context/README.md @@ -0,0 +1,17 @@ +## Example Usage + +```yaml +steps: + - uses: actions/checkout@v4 + + - id: determine-workflow-context + uses: ./.github/actions/determine_workflow_context + + - name: Use run conditions + run: | + echo "Is main branch push: ${{ steps.determine-workflow-context.outputs.is_main_branch_push }}" + echo "Is main branch merge from release: ${{ steps.determine-workflow-context.outputs.is_main_branch_merge_from_release_push }}" + echo "Is release branch PR: ${{ steps.determine-workflow-context.outputs.is_release_branch_pr }}" + echo "Is feature branch PR: ${{ steps.determine-workflow-context.outputs.is_feature_branch_pr }}" + echo "Is feature branch draft PR: ${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr }}" +``` diff --git a/.github/actions/set_run_conditions/action.yml b/.github/actions/determine_workflow_context/action.yml similarity index 77% rename from .github/actions/set_run_conditions/action.yml rename to .github/actions/determine_workflow_context/action.yml index 2e63eab5fc..79b9d74698 100644 --- a/.github/actions/set_run_conditions/action.yml +++ b/.github/actions/determine_workflow_context/action.yml @@ -1,25 +1,25 @@ -name: 'Set run conditions' -description: 'Sets the run conditions based on the current GitHub context' +name: 'Determine workflow context' +description: 'Determines the workflow context based on the current GitHub context' outputs: is_main_branch_push: description: 'True if this is a push to the main branch (excluding merges from release branches)' - value: ${{ steps.set-conditions.outputs.is_main_branch_push }} + value: ${{ steps.determine-workflow-context.outputs.is_main_branch_push }} is_main_branch_push_from_release_merge: description: 'True if this is a push to the main branch from a release branch merge' - value: ${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }} + value: ${{ steps.determine-workflow-context.outputs.is_main_branch_push_from_release_merge }} is_release_branch_pr: description: 'True if this is a pull request from a release branch' - value: ${{ steps.set-conditions.outputs.is_release_branch_pr }} + value: ${{ steps.determine-workflow-context.outputs.is_release_branch_pr }} is_feature_branch_pr: description: 'True if this is a pull request from a feature branch (non-draft)' - value: ${{ steps.set-conditions.outputs.is_feature_branch_pr }} + value: ${{ steps.determine-workflow-context.outputs.is_feature_branch_pr }} is_feature_branch_draft_pr: description: 'True if this is a draft pull request from a feature branch' - value: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }} + value: ${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr }} runs: using: 'composite' steps: - - id: set-conditions + - id: determine-workflow-context run: | # Define conditions using shell variables AZLE_IS_MAIN_BRANCH_PUSH=${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'demergent-labs/release--') }} diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/process_test_conditions/action.yml index 7bd694f129..9d03f6de34 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/process_test_conditions/action.yml @@ -43,7 +43,7 @@ runs: using: 'composite' steps: - id: set-conditions - uses: ./.github/actions/set_run_conditions + uses: ./.github/actions/determine_workflow_context - id: process-conditions shell: bash diff --git a/.github/actions/set_run_conditions/README.md b/.github/actions/set_run_conditions/README.md deleted file mode 100644 index b75f8160f7..0000000000 --- a/.github/actions/set_run_conditions/README.md +++ /dev/null @@ -1,17 +0,0 @@ -## Example Usage - -```yaml -steps: - - uses: actions/checkout@v4 - - - id: set-run-conditions - uses: ./.github/actions/set_run_conditions - - - name: Use run conditions - run: | - echo "Is main branch push: ${{ steps.set-run-conditions.outputs.is_main_branch_push }}" - echo "Is main branch merge from release: ${{ steps.set-run-conditions.outputs.is_main_branch_merge_from_release_push }}" - echo "Is release branch PR: ${{ steps.set-run-conditions.outputs.is_release_branch_pr }}" - echo "Is feature branch PR: ${{ steps.set-run-conditions.outputs.is_feature_branch_pr }}" - echo "Is feature branch draft PR: ${{ steps.set-run-conditions.outputs.is_feature_branch_draft_pr }}" -``` diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index e15fd9c88d..ebdababf01 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -32,6 +32,7 @@ on: jobs: get-test-infos: + name: Get test infos runs-on: ubuntu-latest outputs: test-infos: ${{ steps.get-test-infos.outputs.test-infos }} @@ -69,7 +70,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/set_run_conditions + - uses: ./.github/actions/determine_workflow_context id: set-conditions - name: Set condition environment variables diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da12cbdc77..39c5d5c82f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ on: type: boolean default: true exclude-release-only-tests: - description: 'Exclude release only tests' + description: 'Exclude release-only tests' required: true type: boolean default: true From 1089c014c7816d0be22f03fde03b11f67ca19657 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 14:21:47 -0700 Subject: [PATCH 15/18] rename process test conditions to determine workflow config --- .../determine_workflow_config/README.md | 24 ++++++++++++ .../action.yml | 38 +++++++++---------- .../actions/process_test_conditions/README.md | 24 ------------ .github/workflows/test.yml | 32 ++++++++-------- 4 files changed, 59 insertions(+), 59 deletions(-) create mode 100644 .github/actions/determine_workflow_config/README.md rename .github/actions/{process_test_conditions => determine_workflow_config}/action.yml (58%) delete mode 100644 .github/actions/process_test_conditions/README.md diff --git a/.github/actions/determine_workflow_config/README.md b/.github/actions/determine_workflow_config/README.md new file mode 100644 index 0000000000..c2a867d7c6 --- /dev/null +++ b/.github/actions/determine_workflow_config/README.md @@ -0,0 +1,24 @@ +## Example Usage + +```yaml +steps: + - uses: actions/checkout@v4 + + - id: determine-workflow-config + uses: ./.github/actions/determine_workflow_config + with: + is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} + exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} + exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} + exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} + link-azle-dispatch-input-value: ${{ inputs.link-azle }} + fuzz-dispatch-input-value: ${{ inputs.fuzz-tests }} + + - name: Use determine-workflow-config outputs + run: | + echo "Exclude slow tests: ${{ steps.determine-workflow-config.outputs.exclude-slow }}" + echo "Exclude unstable tests: ${{ steps.determine-workflow-config.outputs.exclude-unstable }}" + echo "Exclude release only tests: ${{ steps.determine-workflow-config.outputs.exclude-release-only }}" + echo "Link to azle: ${{ steps.determine-workflow-config.outputs.link-azle }}" + echo "Fuzz tests: ${{ steps.determine-workflow-config.outputs.fuzz }}" +``` diff --git a/.github/actions/process_test_conditions/action.yml b/.github/actions/determine_workflow_config/action.yml similarity index 58% rename from .github/actions/process_test_conditions/action.yml rename to .github/actions/determine_workflow_config/action.yml index 9d03f6de34..21ee2c9100 100644 --- a/.github/actions/process_test_conditions/action.yml +++ b/.github/actions/determine_workflow_config/action.yml @@ -1,5 +1,5 @@ -name: 'Process Test Conditions' -description: 'Process all test-related conditions and inputs to determine final test configuration' +name: 'Determine workflow config' +description: 'Determines the workflow configuration based on the current GitHub context' inputs: is-workflow-dispatch: @@ -25,27 +25,27 @@ inputs: outputs: exclude-slow: description: 'Whether to exclude slow tests' - value: ${{ steps.process-conditions.outputs.exclude-slow }} + value: ${{ steps.determine_workflow_config.outputs.exclude-slow }} exclude-unstable: description: 'Whether to exclude unstable tests' - value: ${{ steps.process-conditions.outputs.exclude-unstable }} + value: ${{ steps.determine_workflow_config.outputs.exclude-unstable }} exclude-release-only: description: 'Whether to exclude release-only tests' - value: ${{ steps.process-conditions.outputs.exclude-release-only }} + value: ${{ steps.determine_workflow_config.outputs.exclude-release-only }} link-azle: description: 'Whether to link to the development version of azle' - value: ${{ steps.process-conditions.outputs.link-azle }} + value: ${{ steps.determine_workflow_config.outputs.link-azle }} fuzz: description: 'Whether to run fuzz tests' - value: ${{ steps.process-conditions.outputs.fuzz }} + value: ${{ steps.determine_workflow_config.outputs.fuzz }} runs: using: 'composite' steps: - - id: set-conditions + - id: determine-workflow-context uses: ./.github/actions/determine_workflow_context - - id: process-conditions + - id: determine_workflow_config shell: bash run: | if [[ "${{ inputs.is-workflow-dispatch }}" == "true" ]]; then @@ -55,15 +55,15 @@ runs: echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - EXCLUDE_SLOW=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' }} - EXCLUDE_UNSTABLE=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_pr == 'true' }} - EXCLUDE_RELEASE_ONLY=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_main_branch_push == 'true' }} + EXCLUDE_SLOW=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' }} + EXCLUDE_UNSTABLE=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.determine-workflow-context.outputs.is_feature_branch_pr == 'true' }} + EXCLUDE_RELEASE_ONLY=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.determine-workflow-context.outputs.is_feature_branch_pr == 'true' || steps.determine-workflow-context.outputs.is_main_branch_push == 'true' }} echo "exclude-slow=$EXCLUDE_SLOW" >> $GITHUB_OUTPUT echo "exclude-unstable=$EXCLUDE_UNSTABLE" >> $GITHUB_OUTPUT echo "exclude-release-only=$EXCLUDE_RELEASE_ONLY" >> $GITHUB_OUTPUT - if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ - "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then + if [[ "${{ steps.determine-workflow-context.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ + "${{ steps.determine-workflow-context.outputs.is_release_branch_pr }}" == "true" ]]; then echo "link-azle=false" >> $GITHUB_OUTPUT else echo "link-azle=true" >> $GITHUB_OUTPUT @@ -75,9 +75,9 @@ runs: shell: bash run: | echo "=== Test Conditions Outputs ===" - echo "exclude-slow: ${{ steps.process-conditions.outputs.exclude-slow }}" - echo "exclude-unstable: ${{ steps.process-conditions.outputs.exclude-unstable }}" - echo "exclude-release-only: ${{ steps.process-conditions.outputs.exclude-release-only }}" - echo "link-azle: ${{ steps.process-conditions.outputs.link-azle }}" - echo "fuzz: ${{ steps.process-conditions.outputs.fuzz }}" + echo "exclude-slow: ${{ steps.determine_workflow_config.outputs.exclude-slow }}" + echo "exclude-unstable: ${{ steps.determine_workflow_config.outputs.exclude-unstable }}" + echo "exclude-release-only: ${{ steps.determine_workflow_config.outputs.exclude-release-only }}" + echo "link-azle: ${{ steps.determine_workflow_config.outputs.link-azle }}" + echo "fuzz: ${{ steps.determine_workflow_config.outputs.fuzz }}" echo "===========================" diff --git a/.github/actions/process_test_conditions/README.md b/.github/actions/process_test_conditions/README.md deleted file mode 100644 index 665f3e997f..0000000000 --- a/.github/actions/process_test_conditions/README.md +++ /dev/null @@ -1,24 +0,0 @@ -## Example Usage - -```yaml -steps: - - uses: actions/checkout@v4 - - - id: process-test-conditions - uses: ./.github/actions/process_test_conditions - with: - is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} - exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} - exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} - exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} - link-azle-dispatch-input-value: ${{ inputs.link-azle }} - fuzz-dispatch-input-value: ${{ inputs.fuzz-tests }} - - - name: Use process-test-conditions outputs - run: | - echo "Exclude slow tests: ${{ steps.process-test-conditions.outputs.exclude-slow }}" - echo "Exclude unstable tests: ${{ steps.process-test-conditions.outputs.exclude-unstable }}" - echo "Exclude release only tests: ${{ steps.process-test-conditions.outputs.exclude-release-only }}" - echo "Link to azle: ${{ steps.process-test-conditions.outputs.link-azle }}" - echo "Fuzz tests: ${{ steps.process-test-conditions.outputs.fuzz }}" -``` diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39c5d5c82f..cf72dfb479 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,20 +44,20 @@ on: default: true jobs: - process-conditions: - name: Process test conditions + workflow-config: + name: Determine workflow config runs-on: ubuntu-latest outputs: - exclude-slow: ${{ steps.process-conditions.outputs.exclude-slow }} - exclude-unstable: ${{ steps.process-conditions.outputs.exclude-unstable }} - exclude-release-only: ${{ steps.process-conditions.outputs.exclude-release-only }} - link-azle: ${{ steps.process-conditions.outputs.link-azle }} - fuzz: ${{ steps.process-conditions.outputs.fuzz }} + exclude-slow: ${{ steps.determine-workflow-config.outputs.exclude-slow }} + exclude-unstable: ${{ steps.determine-workflow-config.outputs.exclude-unstable }} + exclude-release-only: ${{ steps.determine-workflow-config.outputs.exclude-release-only }} + link-azle: ${{ steps.determine-workflow-config.outputs.link-azle }} + fuzz: ${{ steps.determine-workflow-config.outputs.fuzz }} steps: - uses: actions/checkout@v4 - - id: process-conditions - uses: ./.github/actions/process_test_conditions + - id: determine-workflow-config + uses: ./.github/actions/determine_workflow_config with: is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} @@ -68,7 +68,7 @@ jobs: get-exclude-dirs: name: Get exclude directories - needs: process-conditions + needs: workflow-config runs-on: ubuntu-latest outputs: exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }} @@ -78,14 +78,14 @@ jobs: - id: get-exclude-dirs uses: ./.github/actions/get_exclude_dirs with: - exclude-slow: ${{ needs.process-conditions.outputs.exclude-slow }} - exclude-unstable: ${{ needs.process-conditions.outputs.exclude-unstable }} - exclude-release-only: ${{ needs.process-conditions.outputs.exclude-release-only }} + exclude-slow: ${{ needs.workflow-config.outputs.exclude-slow }} + exclude-unstable: ${{ needs.workflow-config.outputs.exclude-unstable }} + exclude-release-only: ${{ needs.workflow-config.outputs.exclude-release-only }} run-tests: name: ${{ matrix.test_group.name }} needs: - - process-conditions + - workflow-config - get-exclude-dirs strategy: fail-fast: false @@ -140,9 +140,9 @@ jobs: with: directories: ${{ matrix.test_group.directories }} exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} - link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }} + link-azle: ${{ needs.workflow-config.outputs.link-azle == 'true' }} run-experimental: ${{ matrix.test_group.run-experimental || false }} - fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }} + fuzz: ${{ needs.workflow-config.outputs.fuzz == 'true' }} check-test-success: name: Check Azle tests succeeded From 88d1d0f743e2cfb69f19aaedde45c264b8b95310 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 14:24:52 -0700 Subject: [PATCH 16/18] clean up names --- .github/actions/determine_workflow_config/action.yml | 12 ++++++------ .github/actions/determine_workflow_context/README.md | 12 ++++++------ .../actions/determine_workflow_context/action.yml | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/determine_workflow_config/action.yml b/.github/actions/determine_workflow_config/action.yml index 21ee2c9100..8a11653de9 100644 --- a/.github/actions/determine_workflow_config/action.yml +++ b/.github/actions/determine_workflow_config/action.yml @@ -42,7 +42,7 @@ outputs: runs: using: 'composite' steps: - - id: determine-workflow-context + - id: workflow-context uses: ./.github/actions/determine_workflow_context - id: determine_workflow_config @@ -55,15 +55,15 @@ runs: echo "link-azle=${{ inputs.link-azle-dispatch-input-value }}" >> $GITHUB_OUTPUT echo "fuzz=${{ inputs.fuzz-dispatch-input-value }}" >> $GITHUB_OUTPUT else - EXCLUDE_SLOW=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' }} - EXCLUDE_UNSTABLE=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.determine-workflow-context.outputs.is_feature_branch_pr == 'true' }} - EXCLUDE_RELEASE_ONLY=${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.determine-workflow-context.outputs.is_feature_branch_pr == 'true' || steps.determine-workflow-context.outputs.is_main_branch_push == 'true' }} + EXCLUDE_SLOW=${{ steps.workflow-context.outputs.is_feature_branch_draft_pr == 'true' }} + EXCLUDE_UNSTABLE=${{ steps.workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.workflow-context.outputs.is_feature_branch_pr == 'true' }} + EXCLUDE_RELEASE_ONLY=${{ steps.workflow-context.outputs.is_feature_branch_draft_pr == 'true' || steps.workflow-context.outputs.is_feature_branch_pr == 'true' || steps.workflow-context.outputs.is_main_branch_push == 'true' }} echo "exclude-slow=$EXCLUDE_SLOW" >> $GITHUB_OUTPUT echo "exclude-unstable=$EXCLUDE_UNSTABLE" >> $GITHUB_OUTPUT echo "exclude-release-only=$EXCLUDE_RELEASE_ONLY" >> $GITHUB_OUTPUT - if [[ "${{ steps.determine-workflow-context.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ - "${{ steps.determine-workflow-context.outputs.is_release_branch_pr }}" == "true" ]]; then + if [[ "${{ steps.workflow-context.outputs.is_main_branch_push_from_release_merge }}" == "true" || \ + "${{ steps.workflow-context.outputs.is_release_branch_pr }}" == "true" ]]; then echo "link-azle=false" >> $GITHUB_OUTPUT else echo "link-azle=true" >> $GITHUB_OUTPUT diff --git a/.github/actions/determine_workflow_context/README.md b/.github/actions/determine_workflow_context/README.md index 9b34723099..8bb68561f6 100644 --- a/.github/actions/determine_workflow_context/README.md +++ b/.github/actions/determine_workflow_context/README.md @@ -4,14 +4,14 @@ steps: - uses: actions/checkout@v4 - - id: determine-workflow-context + - id: workflow-context uses: ./.github/actions/determine_workflow_context - name: Use run conditions run: | - echo "Is main branch push: ${{ steps.determine-workflow-context.outputs.is_main_branch_push }}" - echo "Is main branch merge from release: ${{ steps.determine-workflow-context.outputs.is_main_branch_merge_from_release_push }}" - echo "Is release branch PR: ${{ steps.determine-workflow-context.outputs.is_release_branch_pr }}" - echo "Is feature branch PR: ${{ steps.determine-workflow-context.outputs.is_feature_branch_pr }}" - echo "Is feature branch draft PR: ${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr }}" + echo "Is main branch push: ${{ steps.workflow-context.outputs.is_main_branch_push }}" + echo "Is main branch merge from release: ${{ steps.workflow-context.outputs.is_main_branch_merge_from_release_push }}" + echo "Is release branch PR: ${{ steps.workflow-context.outputs.is_release_branch_pr }}" + echo "Is feature branch PR: ${{ steps.workflow-context.outputs.is_feature_branch_pr }}" + echo "Is feature branch draft PR: ${{ steps.workflow-context.outputs.is_feature_branch_draft_pr }}" ``` diff --git a/.github/actions/determine_workflow_context/action.yml b/.github/actions/determine_workflow_context/action.yml index 79b9d74698..aceb05a6ad 100644 --- a/.github/actions/determine_workflow_context/action.yml +++ b/.github/actions/determine_workflow_context/action.yml @@ -3,23 +3,23 @@ description: 'Determines the workflow context based on the current GitHub contex outputs: is_main_branch_push: description: 'True if this is a push to the main branch (excluding merges from release branches)' - value: ${{ steps.determine-workflow-context.outputs.is_main_branch_push }} + value: ${{ steps.workflow-context.outputs.is_main_branch_push }} is_main_branch_push_from_release_merge: description: 'True if this is a push to the main branch from a release branch merge' - value: ${{ steps.determine-workflow-context.outputs.is_main_branch_push_from_release_merge }} + value: ${{ steps.workflow-context.outputs.is_main_branch_push_from_release_merge }} is_release_branch_pr: description: 'True if this is a pull request from a release branch' - value: ${{ steps.determine-workflow-context.outputs.is_release_branch_pr }} + value: ${{ steps.workflow-context.outputs.is_release_branch_pr }} is_feature_branch_pr: description: 'True if this is a pull request from a feature branch (non-draft)' - value: ${{ steps.determine-workflow-context.outputs.is_feature_branch_pr }} + value: ${{ steps.workflow-context.outputs.is_feature_branch_pr }} is_feature_branch_draft_pr: description: 'True if this is a draft pull request from a feature branch' - value: ${{ steps.determine-workflow-context.outputs.is_feature_branch_draft_pr }} + value: ${{ steps.workflow-context.outputs.is_feature_branch_draft_pr }} runs: using: 'composite' steps: - - id: determine-workflow-context + - id: workflow-context run: | # Define conditions using shell variables AZLE_IS_MAIN_BRANCH_PUSH=${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'demergent-labs/release--') }} From 9c0533b5d6c5739d62b52426e686ee91b352921d Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Dec 2024 14:28:01 -0700 Subject: [PATCH 17/18] standardize output --- .github/actions/determine_workflow_config/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/determine_workflow_config/action.yml b/.github/actions/determine_workflow_config/action.yml index 8a11653de9..aa4e8f1b42 100644 --- a/.github/actions/determine_workflow_config/action.yml +++ b/.github/actions/determine_workflow_config/action.yml @@ -74,10 +74,9 @@ runs: - id: echo-outputs shell: bash run: | - echo "=== Test Conditions Outputs ===" + echo "Test Conditions Outputs:" echo "exclude-slow: ${{ steps.determine_workflow_config.outputs.exclude-slow }}" echo "exclude-unstable: ${{ steps.determine_workflow_config.outputs.exclude-unstable }}" echo "exclude-release-only: ${{ steps.determine_workflow_config.outputs.exclude-release-only }}" echo "link-azle: ${{ steps.determine_workflow_config.outputs.link-azle }}" echo "fuzz: ${{ steps.determine_workflow_config.outputs.fuzz }}" - echo "===========================" From 06e7e636da69bc24fc7629437bc02bbf6168789e Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 10 Dec 2024 09:56:50 -0700 Subject: [PATCH 18/18] add the word push --- .github/actions/determine_workflow_context/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/determine_workflow_context/README.md b/.github/actions/determine_workflow_context/README.md index 8bb68561f6..6e3b90d485 100644 --- a/.github/actions/determine_workflow_context/README.md +++ b/.github/actions/determine_workflow_context/README.md @@ -10,7 +10,7 @@ steps: - name: Use run conditions run: | echo "Is main branch push: ${{ steps.workflow-context.outputs.is_main_branch_push }}" - echo "Is main branch merge from release: ${{ steps.workflow-context.outputs.is_main_branch_merge_from_release_push }}" + echo "Is main branch merge from release push: ${{ steps.workflow-context.outputs.is_main_branch_merge_from_release_push }}" echo "Is release branch PR: ${{ steps.workflow-context.outputs.is_release_branch_pr }}" echo "Is feature branch PR: ${{ steps.workflow-context.outputs.is_feature_branch_pr }}" echo "Is feature branch draft PR: ${{ steps.workflow-context.outputs.is_feature_branch_draft_pr }}"