Skip to content

Commit 3e5748c

Browse files
committed
fix boolean variable
1 parent e4d8853 commit 3e5748c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/build-test.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

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+
3147
- name: Extract commit hash and version from git
3248
run: ./scripts/extract-hash-and-version.sh
3349

@@ -47,7 +63,7 @@ jobs:
4763
working-directory: ${{ github.workspace }}
4864

4965
- 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' }}
5167
shell: bash
5268
run: |
5369
scripts/lint-tests.sh
@@ -85,13 +101,13 @@ jobs:
85101
scripts/api-operations-gen.sh
86102
87103
- 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' }}
89105
shell: bash
90106
run: |
91107
scripts/api-tests.sh --folder api --html_report
92108
93109
- 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' }}
95111
shell: bash
96112
run: |
97113
scripts/api-tests.sh --folder functions-python --html_report

0 commit comments

Comments
 (0)