Skip to content
This repository was archived by the owner on Nov 1, 2025. It is now read-only.

Commit b702819

Browse files
authored
ci(build): fix cache ccache logic
1 parent 24ccb49 commit b702819

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,19 @@ jobs:
176176
ccache --set-config=hash_dir=false
177177
ccache --set-config=sloppiness=file_macro,include_file_ctime,include_file_mtime,time_macros
178178
ccache --set-config=direct_mode=true
179-
ccache --set-config=max_size=5G
179+
ccache --set-config=max_size=7G
180180
ccache --zero-stats
181181
ccache --show-config
182+
echo "clang_hash=$(clang --version | sha256sum | cut -c1-10 || echo none)" >> "$GITHUB_ENV"
182183
183-
- name: Restore ccache
184+
- name: Cache ccache
184185
uses: actions/cache@v4
185186
with:
186187
path: ${{ env.CCACHE_DIR }}
187-
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.run_id }}
188+
key: ccache-${{ runner.os }}-${{ env.clang_hash }}-${{ inputs.KSU }}-${{ inputs.SUSFS }}-${{ inputs.LXC }}
189+
save-always: true
188190
restore-keys: |
189-
ccache-${{ runner.os }}-${{ github.ref_name }}-
190-
ccache-${{ runner.os }}-
191+
ccache-${{ runner.os }}-${{ env.clang_hash }}-
191192
192193
- name: Build
193194
env:
@@ -197,14 +198,7 @@ jobs:
197198
SOURCE_DATE_EPOCH: "1704067200"
198199
run: |
199200
./cli.sh build
200-
201-
- name: Save ccache
202-
if: always()
203-
uses: actions/cache/save@v4
204-
with:
205-
path: ${{ env.CCACHE_DIR }}
206-
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.run_id }}-${{ inputs.KSU }}-${{ inputs.SUSFS }}-${{ inputs.LXC }}
207-
201+
208202
- name: Import exported environment
209203
id: import_env
210204
run: |

0 commit comments

Comments
 (0)