mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
manual cache management
This commit is contained in:
parent
15425b50a0
commit
b95f3b4322
1 changed files with 33 additions and 6 deletions
39
.github/workflows/desktop-build.yml
vendored
39
.github/workflows/desktop-build.yml
vendored
|
|
@ -166,13 +166,10 @@ jobs:
|
||||||
- name: Restore compiler cache (ccache)
|
- name: Restore compiler cache (ccache)
|
||||||
id: ccache_restore
|
id: ccache_restore
|
||||||
uses: actions/cache/restore@v5
|
uses: actions/cache/restore@v5
|
||||||
env:
|
|
||||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
||||||
with:
|
with:
|
||||||
path: ${{env.CACHE}}
|
path: ${{env.CACHE}}
|
||||||
key: ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}}
|
key: ccache-${{matrix.distro}}${{matrix.version}}-master
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}}-
|
|
||||||
ccache-${{matrix.distro}}${{matrix.version}}-master-
|
ccache-${{matrix.distro}}${{matrix.version}}-master-
|
||||||
|
|
||||||
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image
|
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image
|
||||||
|
|
@ -333,19 +330,34 @@ jobs:
|
||||||
name: ${{matrix.os}} ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
|
name: ${{matrix.os}} ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
|
||||||
needs: configure
|
needs: configure
|
||||||
runs-on: ${{matrix.runner}}
|
runs-on: ${{matrix.runner}}
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: ${{ github.workspace }}/.cache/
|
||||||
|
SCCACHE_DIR: ${{ github.workspace }}/.cache/
|
||||||
|
CCACHE_SIZE: 500M
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Restore compiler cache (ccache)
|
||||||
|
id: ccache_restore
|
||||||
|
uses: actions/cache/restore@v5
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/.cache/
|
||||||
|
key: ${{ matrix.ccache_variant }}-${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-master
|
||||||
|
restore-keys: |
|
||||||
|
${{ matrix.ccache_variant }}-${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-master-
|
||||||
|
|
||||||
- name: Setup ${{ matrix.ccache_variant }}
|
- name: Setup ${{ matrix.ccache_variant }}
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.20
|
uses: hendrikmuhs/ccache-action@v1.2.20
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-${{ github.ref_name }}
|
key: ${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-master
|
||||||
restore-keys: ${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-master
|
restore-keys: ${{ matrix.runner }}-${{ matrix.soc || 'Windows' }}-${{ matrix.type }}-master-
|
||||||
max-size: 500M
|
max-size: 500M
|
||||||
variant: ${{ matrix.ccache_variant }}
|
variant: ${{ matrix.ccache_variant }}
|
||||||
|
save: false
|
||||||
|
|
||||||
- name: Setup MSVC (Windows)
|
- name: Setup MSVC (Windows)
|
||||||
if: matrix.os == 'Windows'
|
if: matrix.os == 'Windows'
|
||||||
|
|
@ -436,6 +448,21 @@ jobs:
|
||||||
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
|
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
|
||||||
run: .ci/compile.sh --server --test --vcpkg
|
run: .ci/compile.sh --server --test --vcpkg
|
||||||
|
|
||||||
|
# github does not overwrite GHA cache entries when the key is the same, so we need to delete the stale ones before saving
|
||||||
|
- name: Delete stale ccache
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh cache delete "${{ steps.ccache_restore.outputs.cache-primary-key }}" || true
|
||||||
|
|
||||||
|
- name: Save compiler cache (ccache)
|
||||||
|
if: github.ref == 'refs/heads/master' && steps.build.outcome == 'success'
|
||||||
|
uses: actions/cache/save@v5
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/.cache/
|
||||||
|
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
|
||||||
|
|
||||||
- name: Sign app bundle
|
- name: Sign app bundle
|
||||||
if: matrix.os == 'macOS' && matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null)
|
if: matrix.os == 'macOS' && matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null)
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue