|
28 | 28 | - name: Checkout code |
29 | 29 | uses: actions/checkout@v4 |
30 | 30 |
|
| 31 | + - name: Set whether to run tests |
| 32 | + id: set-should-run-tests |
| 33 | + run: | |
| 34 | + if [[ "$GITHUB_EVENT_NAME" != "workflow_call" ]]; then |
| 35 | + echo "result=true" >> "$GITHUB_OUTPUT" |
| 36 | + elif [[ "$INPUTS_SKIP_TESTS" == "false" ]]; then |
| 37 | + echo "result=true" >> "$GITHUB_OUTPUT" |
| 38 | + else |
| 39 | + echo "result=false" >> "$GITHUB_OUTPUT" |
| 40 | + fi |
| 41 | + env: |
| 42 | + INPUTS_SKIP_TESTS: ${{ inputs.SKIP_TESTS }} |
| 43 | + |
| 44 | + - name: Echo decision (debug) |
| 45 | + run: echo "Tests should run? ${{ steps.set-should-run-tests.outputs.result }}" |
| 46 | + |
31 | 47 | - name: Extract commit hash and version from git |
32 | 48 | run: ./scripts/extract-hash-and-version.sh |
33 | 49 |
|
|
47 | 63 | working-directory: ${{ github.workspace }} |
48 | 64 |
|
49 | 65 | - name: Run lint checks |
50 | | - if: ${{ github.event_name == 'workflow_call' && inputs.SKIP_TESTS || false }} |
| 66 | + if: ${{ steps.set-should-run-tests.outputs.result == 'true' }} |
51 | 67 | shell: bash |
52 | 68 | run: | |
53 | 69 | scripts/lint-tests.sh |
@@ -85,13 +101,13 @@ jobs: |
85 | 101 | scripts/api-operations-gen.sh |
86 | 102 |
|
87 | 103 | - name: Unit tests - API |
88 | | - if: ${{ github.event_name == 'workflow_call' && inputs.SKIP_TESTS || false }} |
| 104 | + if: ${{ steps.set-should-run-tests.outputs.result == 'true' }} |
89 | 105 | shell: bash |
90 | 106 | run: | |
91 | 107 | scripts/api-tests.sh --folder api --html_report |
92 | 108 |
|
93 | 109 | - name: Unit tests - Python Functions |
94 | | - if: ${{ github.event_name == 'workflow_call' && inputs.SKIP_TESTS || false }} |
| 110 | + if: ${{ steps.set-should-run-tests.outputs.result == 'true' }} |
95 | 111 | shell: bash |
96 | 112 | run: | |
97 | 113 | scripts/api-tests.sh --folder functions-python --html_report |
|
0 commit comments