Skip to content

Commit

Permalink
GHA: add cache
Browse files Browse the repository at this point in the history
restore ccache data before build

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Dec 10, 2024
1 parent dc4a486 commit 9383bc4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ jobs:
run: |
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
- name: Ccache
id: ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-test_x86-${{ github.run_id }}
restore-keys: ccache-test_x86

- name: Twister build and run x86 tests
run: |
source zephyr/zephyr-env.sh
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/run_tests_dut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ jobs:
run: |
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
- name: Replace slash with underscore
id: replace
run: |
TARGET_BOARD=${{ inputs.target_board }}
TARGET_BOARD=${TARGET_BOARD//\//_}
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
- name: Ccache
id: ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-tests_dut-${{ inputs.subset }}-${{steps.replace.outputs.target_board}}-${{ github.run_id }}
restore-keys: ccache-tests_dut-${{ inputs.subset }}-${{ steps.replace.outputs.target_board}}

- name: Build DUT test artifacts
run: |
source zephyr/zephyr-env.sh
Expand All @@ -70,13 +85,6 @@ jobs:
run: |
ccache -ps;
- name: Replace slash with underscore
id: replace
run: |
TARGET_BOARD=${{ inputs.target_board }}
TARGET_BOARD=${TARGET_BOARD//\//_}
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
- name: Save build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/samples_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ jobs:
TARGET_BOARD=${TARGET_BOARD//\//_}
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
- name: Ccache
id: ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}-${{ github.run_id }}
restore-keys: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}

- name: Twister build samples
run: |
source zephyr/zephyr-env.sh
Expand Down

0 comments on commit 9383bc4

Please sign in to comment.