diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-08-19 14:41:02 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-20 10:34:52 +0200 |
commit | 25ae1f7f7233deeefe793028552cb22f85b71d86 (patch) | |
tree | 5b435b67ffa5d455772a620c5b2861142158f735 /Meta/Azure/Caches.yml | |
parent | 8fce5caa4938697734c855d2905d0c65073510f0 (diff) | |
download | serenity-25ae1f7f7233deeefe793028552cb22f85b71d86.zip |
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.
Diffstat (limited to 'Meta/Azure/Caches.yml')
-rw-r--r-- | Meta/Azure/Caches.yml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Meta/Azure/Caches.yml b/Meta/Azure/Caches.yml index 5ecfe58d68..99a9b1aa27 100644 --- a/Meta/Azure/Caches.yml +++ b/Meta/Azure/Caches.yml @@ -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' |