Skip to content

Commit

Permalink
GitHub actions: Fix caching
Browse files Browse the repository at this point in the history
Removing timestamp was incorrect - if the cache key
is the same as we restored from, the cache will not
be uploaded at all.

Amends ca74c52.

Change-Id: I53c32a5f4950c98b2be38fa2be8391e9870f1d6f
  • Loading branch information
ABBAPOH committed May 13, 2024
1 parent 921be49 commit 3ed5a43
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 14 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ jobs:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
- name: Pull the Docker Image
run: docker-compose pull ${{ matrix.config.image }}
- name: Print ccache stats
Expand Down Expand Up @@ -110,11 +115,16 @@ jobs:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
- name: Pull the Docker Image
run: docker-compose pull ${{ matrix.config.image }}
- name: Print ccache stats
Expand Down Expand Up @@ -157,11 +167,16 @@ jobs:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache
key: ${{ runner.os }}-clang-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-clang-ccache
- name: Install required packages
run: |
brew install ccache p7zip
Expand Down Expand Up @@ -207,12 +222,17 @@ jobs:
QT_ASSUME_STDERR_HAS_CONSOLE: 1
steps:
- uses: actions/checkout@v1
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: clcache cache files
uses: actions/cache@v4
with:
path: ~/clcache
key: ${{ runner.os }}-msvc-clcache
- name: Set up Python ${{ matrix.python-version }}
key: ${{ runner.os }}-msvc-clcache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-msvc-clcache
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
Expand Down Expand Up @@ -264,12 +284,17 @@ jobs:
CCACHE_DIR: ${{ github.workspace }}\ccache
steps:
- uses: actions/checkout@v1
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ccache
key: ${{ runner.os }}-mingw-ccache
- name: Set up Python ${{ matrix.python-version }}
path: ~/.ccache
key: ${{ runner.os }}-mingw-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-mingw-ccache
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ jobs:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: test
run: echo ${{ github.ref }}
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
key: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-${{ matrix.config.cacheid }}-ccache
- name: Pull the Docker Image
run: docker-compose pull jammy-qt6
- name: Print ccache stats
Expand Down Expand Up @@ -77,11 +80,16 @@ jobs:
- uses: actions/checkout@v1
- name: Create .ccache dir
run: mkdir -p ~/.ccache
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-release-ccache
key: ${{ runner.os }}-release-ccache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-release-ccache
- name: Install required packages
run: |
brew install ccache p7zip
Expand Down Expand Up @@ -124,11 +132,16 @@ jobs:
- name: Create .ccache dir
run: mkdir -p ~/.ccache
shell: bash
- name: prepare timestamp
id: get-timestamp
run: echo "timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
shell: bash
- name: clcache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-release-msvc-docker-clcache
path: ~/clcache
key: ${{ runner.os }}-release-msvc-docker-clcache-${{ steps.get-timestamp.outputs.timestamp }}
restore-keys: ${{ runner.os }}-release-msvc-docker-clcache
- name: Pull the Windows Image
run: docker-compose pull windows
- name: Print clcache stats
Expand Down

0 comments on commit 3ed5a43

Please sign in to comment.