From ac36011ae2fca62c365909745ced5daa404e2f08 Mon Sep 17 00:00:00 2001 From: Manu Bretelle Date: Thu, 26 Oct 2023 19:08:50 -0700 Subject: [PATCH] tests: Control execution of test job from the caller, not the callee @danielocfb brought this up in #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 --- .github/workflows/kernel-build-test.yml | 7 ++++++- .github/workflows/kernel-test.yml | 1 - .github/workflows/test.yml | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel-build-test.yml b/.github/workflows/kernel-build-test.yml index 69e5003c..91eb635c 100644 --- a/.github/workflows/kernel-build-test.yml +++ b/.github/workflows/kernel-build-test.yml @@ -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 @@ -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 diff --git a/.github/workflows/kernel-test.yml b/.github/workflows/kernel-test.yml index 819af048..9555c6f1 100644 --- a/.github/workflows/kernel-test.yml +++ b/.github/workflows/kernel-test.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9a2e6d3..ba099483 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 }}