aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-09-13 12:14:12 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-09-14 11:18:47 +0000
commitb088f765f8133beecde23fa9fa6888b976764bd1 (patch)
tree6d52bd060669f20866948a1f6ec02191992f4965 /.github
parentadabfae38e3bc4f899907759fcbb338d0170a0a4 (diff)
GitHub actions: Fix caching on Windows (v2)
There is no way to manually clear the cache and we have an entry "Windows-clcache-" stuck in cache which is exact match for the restore- keys and thus it has a higher priority than the key with timestamp. Fix that by changing key used on Windows. Also, simplify "prepare timestamp" steps This amends 3dcfba17b. Change-Id: I10bdd6dd3e4607870de49facdfcb43e842579552 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/main.yml34
1 files changed, 13 insertions, 21 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 730966c66..e76111b35 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -29,15 +29,13 @@ jobs:
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
- id: ccache_cache_timestamp
- run: |
- export TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- echo ::set-output name=timestamp::$TIMESTAMP
+ id: get-timestamp
+ run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
- key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+ key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-
- name: Pull the Bionic Image
run: docker-compose pull bionic
@@ -86,15 +84,13 @@ jobs:
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
- id: ccache_cache_timestamp
- run: |
- export TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- echo ::set-output name=timestamp::$TIMESTAMP
+ id: get-timestamp
+ run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
- key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+ key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-
- name: Pull the Bionic Image
run: docker-compose pull bionic
@@ -123,15 +119,13 @@ jobs:
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
- id: ccache_cache_timestamp
- run: |
- export TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- echo ::set-output name=timestamp::$TIMESTAMP
+ id: get-timestamp
+ run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
- key: ${{ runner.os }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+ key: ${{ runner.os }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-ccache-
- name: Install required packages
run: |
@@ -177,17 +171,15 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: prepare timestamp
- id: ccache_cache_timestamp
- run: |
- export TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- echo ::set-output name=timestamp::$TIMESTAMP
+ id: get-timestamp
+ run: echo ::set-output name=timestamp::$(date -u +"%Y-%m-%dT%H:%M:%SZ")
shell: bash
- name: clcache cache files
uses: actions/cache@v2
with:
path: ~/clcache
- key: ${{ runner.os }}-clcache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
- restore-keys: ${{ runner.os }}-clcache-
+ key: ${{ runner.os }}-msvc-clcache-${{ steps.get-timestamp.outputs.timestamp }}
+ restore-keys: ${{ runner.os }}-msvc-clcache-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with: