mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
CI: Include a timestamp in the Azure ccache key
Caches on Azure are immutable - so if a cache changes, but its key does not, then the cache is not updated. Include a timestamp in the ccache key so that we always push an updated cache from the master branch. Then use a subkey without the timestamp to pull the cache. We use a similar trick on GitHub Actions.
This commit is contained in:
parent
8fce5caa49
commit
25ae1f7f72
1 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,10 @@ parameters:
|
||||||
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- script: |
|
||||||
|
echo "##vso[task.setvariable variable=timestamp]$(date -u +"%Y%m%d%H%M_%S")"
|
||||||
|
displayName: 'Stamps'
|
||||||
|
|
||||||
- ${{ if ne(parameters.arch, 'Lagom') }}:
|
- ${{ if ne(parameters.arch, 'Lagom') }}:
|
||||||
- ${{ if eq(parameters.toolchain, 'clang') }}:
|
- ${{ if eq(parameters.toolchain, 'clang') }}:
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
|
@ -22,7 +26,9 @@ steps:
|
||||||
|
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
inputs:
|
inputs:
|
||||||
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"'
|
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
||||||
|
restoreKeys: |
|
||||||
|
"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
|
||||||
path: $(CCACHE_DIR)
|
path: $(CCACHE_DIR)
|
||||||
displayName: 'Compiler Cache'
|
displayName: 'Compiler Cache'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue