1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:38:13 +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:
Timothy Flynn 2021-08-19 14:41:02 -04:00 committed by Andreas Kling
parent 8fce5caa49
commit 25ae1f7f72

View file

@ -6,6 +6,10 @@ parameters:
ccache_version: 1 # Increment this number if CI has trouble with ccache.
steps:
- script: |
echo "##vso[task.setvariable variable=timestamp]$(date -u +"%Y%m%d%H%M_%S")"
displayName: 'Stamps'
- ${{ if ne(parameters.arch, 'Lagom') }}:
- ${{ if eq(parameters.toolchain, 'clang') }}:
- task: Cache@2
@ -22,7 +26,9 @@ steps:
- task: Cache@2
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)
displayName: 'Compiler Cache'