Skip to content

Commit 7986e16

Browse files
committed
Use cache in build workflow only if use-cached is true
1 parent 2b2925b commit 7986e16

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ on:
2424
version:
2525
required: true
2626
type: string
27+
use-cached:
28+
required: false
29+
type: boolean
30+
default: false
2731
workflow_call:
2832
inputs:
2933
host-os:
@@ -39,6 +43,10 @@ on:
3943
version:
4044
required: true
4145
type: string
46+
use-cached:
47+
required: false
48+
type: boolean
49+
default: false
4250

4351
jobs:
4452
build:
@@ -48,6 +56,7 @@ jobs:
4856
ack: ${{ inputs.ack }}
4957
arch: ${{ inputs.arch }}
5058
version: ${{ inputs.version }}
59+
use-cached: ${{ inputs.use-cached }}
5160

5261
test:
5362
uses: ./.github/workflows/test.yml

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
version:
2424
required: true
2525
type: string
26-
cache:
26+
use-cached:
2727
required: false
2828
type: boolean
2929
default: false
@@ -42,7 +42,7 @@ on:
4242
version:
4343
required: true
4444
type: string
45-
cache:
45+
use-cached:
4646
required: false
4747
type: boolean
4848
default: false
@@ -133,8 +133,8 @@ jobs:
133133
134134
echo "ARTIFACT_DIR=kernel-artifacts-${SUFFIX}" >> $GITHUB_OUTPUT
135135
136-
# TODO: Control caching with an input argument
137136
- name: Cache kernel image
137+
if: ${{ inputs.use-cached == true }}
138138
id: cache-kernel
139139
uses: actions/cache@v4
140140
with:

0 commit comments

Comments
 (0)