Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Control execution of test job from the caller, not the callee #246

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/kernel-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ 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.
download_sources:
required: true
type: boolean
description: Whether to download the linux sources into the working directory.
default: false
secrets:
AWS_ROLE_ARN:
required: true
Expand All @@ -50,8 +59,10 @@ jobs:
runs_on: ${{ inputs.runs_on }}
llvm-version: ${{ inputs.llvm-version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}

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
9 changes: 7 additions & 2 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
required: true
type: string
description: The kernel to run the test against. For KPD this is always LATEST, which runs against a newly built kernel.
download_sources:
required: true
type: boolean
description: Whether to download the linux sources into the working directory.
default: false


jobs:
Expand All @@ -46,12 +51,12 @@ jobs:
# builds (which may check out some earlier upstream change).
with:
fetch-depth: 50
- if: ${{ github.repository == 'kernel-patches/vmtest' }}
- if: ${{ inputs.download_sources }}
name: Download bpf-next tree
uses: libbpf/ci/get-linux-source@main
with:
dest: '.kernel'
- if: ${{ github.repository == 'kernel-patches/vmtest' }}
- if: ${{ inputs.download_sources }}
name: Move linux source in place
shell: bash
run: |
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,9 @@ 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' }}
# Download sources
download_sources: ${{ github.repository == 'kernel-patches/vmtest' }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
Loading