Skip to content

Commit 81d314a

Browse files
committed
build: control whether to download sources from the calling workflow
Signed-off-by: Manu Bretelle <chantr4@gmail.com>
1 parent e7b7da7 commit 81d314a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.github/workflows/kernel-build-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ on:
3939
required: true
4040
type: boolean
4141
description: Whether or not to run the test job.
42+
download_sources:
43+
required: true
44+
type: boolean
45+
description: Whether to download the linux sources into the working directory.
46+
default: false
4247
secrets:
4348
AWS_ROLE_ARN:
4449
required: true
@@ -54,6 +59,7 @@ jobs:
5459
runs_on: ${{ inputs.runs_on }}
5560
llvm-version: ${{ inputs.llvm-version }}
5661
kernel: ${{ inputs.kernel }}
62+
download_sources: ${{ inputs.download_sources }}
5763

5864
test:
5965
if: ${{ inputs.run_tests }}

.github/workflows/kernel-build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
required: true
2929
type: string
3030
description: The kernel to run the test against. For KPD this is always LATEST, which runs against a newly built kernel.
31+
download_sources:
32+
required: true
33+
type: boolean
34+
description: Whether to download the linux sources into the working directory.
35+
default: false
3136

3237

3338
jobs:
@@ -46,12 +51,12 @@ jobs:
4651
# builds (which may check out some earlier upstream change).
4752
with:
4853
fetch-depth: 50
49-
- if: ${{ github.repository == 'kernel-patches/vmtest' }}
54+
- if: ${{ inputs.download_sources }}
5055
name: Download bpf-next tree
5156
uses: libbpf/ci/get-linux-source@main
5257
with:
5358
dest: '.kernel'
54-
- if: ${{ github.repository == 'kernel-patches/vmtest' }}
59+
- if: ${{ inputs.download_sources }}
5560
name: Move linux source in place
5661
shell: bash
5762
run: |

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,7 @@ jobs:
5050
run_veristat: ${{ matrix.run_veristat }}
5151
# We only run tests on pull requests.
5252
run_tests: ${{ github.event_name != 'push' }}
53+
# Download sources
54+
download_sources: ${{ github.repository == 'kernel-patches/vmtest' }}
5355
secrets:
5456
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}

0 commit comments

Comments
 (0)