Skip to content

Commit 82d23d0

Browse files
committed
ci: improve CI caching scheme
- Split caching into separate restore/save, which allows us to save the ccache even for jobs with failed tests, not only when all tests succeed. This makes subsequent builds, that we do on the same branch while attempting to fix failures, go faster by using the cache. - Rearrange the step order so we save cache before tests run. This allows us to terminate a CI run because we are seeing tests fail, but still have the cache saved to speed up subsequent runs. Signed-off-by: Larry Gritz <[email protected]>
1 parent a6e507c commit 82d23d0

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

.github/workflows/build-steps.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ jobs:
117117
id: ccache_cache_keys
118118
shell: bash
119119
run: echo "date=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" >> $GITHUB_OUTPUT
120-
- name: ccache
121-
id: ccache
122-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
120+
- name: ccache-restore
121+
id: ccache-restore
122+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
123123
with:
124124
path: ./ccache
125125
key: ${{github.job}}-${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
@@ -160,6 +160,26 @@ jobs:
160160
if: inputs.skip_build != '1'
161161
shell: bash
162162
run: src/build-scripts/ci-build.bash
163+
- name: Check out ABI standard
164+
if: inputs.abi_check != ''
165+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
166+
with:
167+
ref: ${{inputs.abi_check}}
168+
path: abi_standard
169+
- name: Build ABI standard
170+
if: inputs.abi_check != ''
171+
shell: bash
172+
run: |
173+
mkdir -p abi_standard/build
174+
pushd abi_standard
175+
src/build-scripts/ci-build.bash
176+
popd
177+
- name: ccache-save
178+
id: ccache-save
179+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
180+
with:
181+
path: ./ccache
182+
key: ${{github.job}}-${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
163183
- name: Testsuite
164184
if: inputs.skip_tests != '1'
165185
shell: bash
@@ -184,20 +204,6 @@ jobs:
184204
# sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
185205
time sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="$BUILD_WRAPPER_OUT_DIR" --define sonar.cfamily.gcov.reportsPath="_coverage" --define sonar.cfamily.threads="$PARALLEL"
186206
# Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options
187-
- name: Check out ABI standard
188-
if: inputs.abi_check != ''
189-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
190-
with:
191-
ref: ${{inputs.abi_check}}
192-
path: abi_standard
193-
- name: Build ABI standard
194-
if: inputs.abi_check != ''
195-
shell: bash
196-
run: |
197-
mkdir -p abi_standard/build
198-
pushd abi_standard
199-
src/build-scripts/ci-build.bash
200-
popd
201207
- name: Check ABI
202208
if: inputs.abi_check != ''
203209
shell: bash

0 commit comments

Comments
 (0)