Skip to content

Commit

Permalink
tests: Control execution of test job from the caller, not the callee
Browse files Browse the repository at this point in the history
@danielocfb brought this up in kernel-patches#244.
e.g we should control whether to execute the test job not from the job itself,
but from the caller.

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
  • Loading branch information
chantra committed Oct 27, 2023
1 parent 1eed97e commit ac36011
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/kernel-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ on:
run_veristat:
required: true
type: boolean
description: Whether or not to run veristat
description: Whether or not to run the veristat job.
run_tests:
required: true
type: boolean
description: Whether or not to run the test job.
secrets:
AWS_ROLE_ARN:
required: true
Expand All @@ -52,6 +56,7 @@ jobs:
kernel: ${{ inputs.kernel }}

test:
if: ${{ inputs.run_tests }}
uses: ./.github/workflows/kernel-test.yml
# Setting name to test here to avoid lengthy autogenerated names due to matrix
# e.g build-and-test x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ on:

jobs:
test:
if: ${{ github.event_name != 'push' }}
name: ${{ inputs.test }} on ${{ inputs.arch }} with ${{ inputs.toolchain_full }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: 100
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ jobs:
kernel: ${{ matrix.kernel }}
tests: ${{ toJSON(matrix.tests) }}
run_veristat: ${{ matrix.run_veristat }}
# We only run tests on pull requests.
run_tests: ${{ github.event_name != 'push' }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}

0 comments on commit ac36011

Please sign in to comment.