Skip to content

Commit

Permalink
build: control whether to download sources from the calling workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Manu Bretelle <[email protected]>
  • Loading branch information
chantra committed Oct 27, 2023
1 parent ac36011 commit 2567cfa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/kernel-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ on:
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 @@ -54,6 +59,7 @@ jobs:
runs_on: ${{ inputs.runs_on }}
llvm-version: ${{ inputs.llvm-version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}

test:
if: ${{ inputs.run_tests }}
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ jobs:
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 }}

0 comments on commit 2567cfa

Please sign in to comment.