Testing dependent jobs, input parameter skip_tests=false #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: testing-dependent-jobs | ||
|
Check failure on line 1 in .github/workflows/testing-dependent-jobs.yml
|
||
| run-name: Testing dependent jobs, input parameter skip_tests=${{ inputs.skip_tests }} | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| skip_tests: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| description: 'Skip tests during release build' | ||
| jobs: | ||
| job-01: | ||
| runs-on: ubuntu-22.04 | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: step1 | ||
| run: echo this is step1 | ||
| job-2-01: | ||
| name: Job-2-01 - could be skipped | ||
| if: ${{inputs.skip_tests}} | ||
| runs-on: ubuntu-22.04 | ||
| needs: [ job-01 ] | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: step2-01 | ||
| run: echo this is step2-01 | ||
| job-2-02: | ||
| name: Job-2-02 - could be skipped | ||
| if: ! ${{inputs.skip_tests}} | ||
| runs-on: ubuntu-22.04 | ||
| needs: [ job-01 ] | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: step2-02 | ||
| run: echo this is step2-02 | ||
| - name: Testing failure | ||
| run: exit 1 | ||
| job-3-01: | ||
| name: Job-3-01 - debug outputs | ||
| runs-on: ubuntu-22.04 | ||
| needs: [ job-2-01, job-2-02 ] | ||
| if: always() | ||
| steps: | ||
| - name: Print debug outputs | ||
| run: | | ||
| echo job-2-01 result: ${{ needs.job-2-01.result }} , job-2-02 result: ${{ needs.job-2-02.result }} | ||