Skip to content

Commit

Permalink
CI: use better cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdawson committed Aug 2, 2024
1 parent f2dc3fc commit 9ca6736
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/gdext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
vcpkg_tag: 1de2026f28ead93ff1773e6e680387643e914ea1 # 2024.07.12

jobs:
# TODO: refactor to matrix
windows:
name: 🪟Windows
runs-on: windows-latest
Expand All @@ -35,13 +36,17 @@ jobs:
with:
vcpkgGitCommitId: ${{ env.vcpkg_tag }}

- shell: bash
run: |
echo "cache_key=godot-cpp-$(git -C gdext/godot-cpp rev-parse --short HEAD)-${{ runner.os }}-$ImageVersion" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache-godot-cpp
if: github.ref_type != 'tag'
with:
path: |
gdext/scons_cache
key: godot-cpp-${{ runner.os }}-${{ hashFiles('gdext/godot-cpp/gdextension/extension_api.json') }}
key: ${{ env.cache_key }}

- name: Build
if: github.ref_type != 'tag'
Expand Down Expand Up @@ -93,12 +98,16 @@ jobs:
with:
vcpkgGitCommitId: ${{ env.vcpkg_tag }}

- shell: bash
run: |
echo "cache_key=godot-cpp-$(git -C gdext/godot-cpp rev-parse --short HEAD)-${{ runner.os }}-$ImageVersion" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache-godot-cpp
with:
path: |
gdext/scons_cache
key: godot-cpp-${{ runner.os }}-${{ hashFiles('gdext/godot-cpp/gdextension/extension_api.json') }}
key: ${{ env.cache_key }}

- name: Build debug
run: |
Expand Down Expand Up @@ -144,12 +153,16 @@ jobs:
with:
vcpkgGitCommitId: ${{ env.vcpkg_tag }}

- shell: bash
run: |
echo "cache_key=godot-cpp-$(git -C gdext/godot-cpp rev-parse --short HEAD)-${{ runner.os }}-$ImageVersion" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache-godot-cpp
with:
path: |
gdext/scons_cache
key: godot-cpp-${{ runner.os }}-${{ hashFiles('gdext/godot-cpp/gdextension/extension_api.json') }}
key: ${{ env.cache_key }}

- name: Build debug
run: |
Expand Down

0 comments on commit 9ca6736

Please sign in to comment.