Skip to content

Commit 0a2667d

Browse files
GHA: add cache
restore ccache data before build Signed-off-by: Robert Gałat <[email protected]>
1 parent 8a24ff4 commit 0a2667d

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

.github/workflows/run_tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ jobs:
4545
run: |
4646
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
4747
48+
- name: Ccache
49+
id: ccache
50+
uses: actions/cache@v4
51+
with:
52+
path: ~/.cache/ccache
53+
key: ccache-test_x86-${{ github.run_id }}
54+
restore-keys: ccache-test_x86-
55+
4856
- name: Twister build and run x86 tests
4957
run: |
5058
source zephyr/zephyr-env.sh

.github/workflows/run_tests_dut.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ jobs:
6161
run: |
6262
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
6363
64+
- name: Replace slash with underscore
65+
id: replace
66+
run: |
67+
TARGET_BOARD=${{ inputs.target_board }}
68+
TARGET_BOARD=${TARGET_BOARD//\//_}
69+
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
70+
71+
- name: Ccache
72+
id: ccache
73+
uses: actions/cache@v4
74+
with:
75+
path: ~/.cache/ccache
76+
key: ccache-tests_dut-${{ inputs.subset }}-${{steps.replace.outputs.target_board}}-${{ github.run_id }}
77+
restore-keys: ccache-tests_dut-${{ inputs.subset }}-${{ steps.replace.outputs.target_board}}-
78+
6479
- name: Build DUT test artifacts
6580
run: |
6681
source zephyr/zephyr-env.sh
@@ -70,13 +85,6 @@ jobs:
7085
run: |
7186
ccache -ps;
7287
73-
- name: Replace slash with underscore
74-
id: replace
75-
run: |
76-
TARGET_BOARD=${{ inputs.target_board }}
77-
TARGET_BOARD=${TARGET_BOARD//\//_}
78-
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
79-
8088
- name: Save build artifacts
8189
uses: actions/upload-artifact@v4
8290
with:

.github/workflows/samples_build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ jobs:
6666
TARGET_BOARD=${TARGET_BOARD//\//_}
6767
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
6868
69+
- name: Ccache
70+
id: ccache
71+
uses: actions/cache@v4
72+
with:
73+
path: ~/.cache/ccache
74+
key: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}-${{ github.run_id }}
75+
restore-keys: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}-
76+
6977
- name: Twister build samples
7078
run: |
7179
source zephyr/zephyr-env.sh

0 commit comments

Comments
 (0)