Skip to content

Commit

Permalink
fix(ci): add caching for Catch2 installation in GitHub Actions workfl…
Browse files Browse the repository at this point in the history
…ow to improve build efficiency
  • Loading branch information
loliGothicK committed Feb 13, 2025
1 parent ff38aa7 commit 1e64db5
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ jobs:
if: matrix.compiler.cxx == 'g++' && matrix.compiler.ver == 14
run: sudo apt update && sudo apt install -y gcc-14

- name: Cache Catch2
id: cache
uses: actions/cache@v4
with:
path: $VCPKG_INSTALLATION_ROOT/installed
key: ${{ runner.os }}-

- name: Install Catch2
if: steps.cache.outputs.cache-hit != 'true'
run: vcpkg install catch2

- name: Build and test
Expand All @@ -68,12 +76,18 @@ jobs:
os: 2025
- vs: "Visual Studio 17 2022"
os: 2022
- vs: "Visual Studio 16 2019"
os: 2019
steps:
- uses: actions/checkout@v4

- name: Cache Catch2
id: cache
uses: actions/cache@v4
with:
path: $VCPKG_INSTALLATION_ROOT/installed
key: ${{ runner.os }}-

- name: Install Catch2
if: steps.cache.outputs.cache-hit != 'true'
run: vcpkg install catch2

- name: Build and test
Expand All @@ -94,7 +108,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache Catch2
id: cache
uses: actions/cache@v4
with:
path: ~/vcpkg/installed
key: ${{ runner.os }}-

- name: Install vcpkg
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ~
git clone https://github.com/microsoft/vcpkg
Expand Down

0 comments on commit 1e64db5

Please sign in to comment.