Skip to content

Commit

Permalink
Try cache the 3rd party build step
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicNibble committed Apr 9, 2024
1 parent 16450a2 commit a0e7224
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,29 @@ jobs:
- uses: abel0b/[email protected]
with:
version: "5.0.0-beta2"

# Determine the current submodule commit hash for cache key
- name: Get GoogleBench Submodule Commit
id: submodule_gbench_commit
run: |
cd 3rdparty/source/googlebench
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Get GoogleTest Submodule Commit
id: submodule_gtest_commit
run: |
cd 3rdparty/source/gtest
echo "::set-output name=commit::$(git rev-parse HEAD)"
# Cache third-party libraries
- name: Cache Third-Party Libraries
id: cache
uses: actions/cache@v4
with:
path: 3rdparty/lib
key: ${{ runner.os }}-third-party-libs-${{ hashFiles('3rdparty/build.sh') }}-${{ hashFiles('3rdparty/premake5.lua') }}-${{ steps.submodule_gbench_commit.outputs.commit }}-${{ steps.submodule_gtest_commit.outputs.commit }}

- name: Build 3rdparty
if: steps.cache-primes.outputs.cache-hit != 'true'
run: |
cd 3rdparty
premake5 gmake2
Expand Down

0 comments on commit a0e7224

Please sign in to comment.