Skip to content

Commit e6b2173

Browse files
committed
Add cache
1 parent 1931828 commit e6b2173

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ jobs:
2121
- os: windows-latest
2222
triplet: x64-windows-release
2323
build_type: Release
24+
test_target: RUN_TESTS
25+
binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives
26+
vcpkg_path: C:/vcpkg/installed/vcpkg/info/*
27+
2428
steps:
2529
- uses: actions/checkout@v4
2630
with:
2731
submodules: true
2832

33+
- name: Restore cache dependencies
34+
uses: actions/cache/restore@v4
35+
with:
36+
path: ${{ matrix.binary_cache }}
37+
key: ${{ matrix.os }}
38+
restore-keys: ${{ matrix.os }}
39+
2940
- name: "Install dependencies"
3041
run: >
3142
vcpkg x-set-installed --triplet ${{ matrix.triplet }}
@@ -43,13 +54,26 @@ jobs:
4354
fcl
4455
pkgconf
4556
57+
- name: copy files for hash
58+
shell: bash
59+
run: |
60+
mkdir -p vcpkg-info
61+
cp ${{ matrix.vcpkg_path }} vcpkg-info
62+
63+
- name: Save cache dependencies
64+
id: cache-save
65+
uses: actions/cache/save@v4
66+
with:
67+
path: ${{ matrix.binary_cache }}
68+
key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }}
69+
4670
- name: cmake generate
4771
shell: bash
4872
run: >
4973
cmake -B build
5074
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake
5175
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
52-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
76+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
5377
-DOMPL_VERSIONED_INSTALL=OFF
5478
-DOMPL_BUILD_DEMOS=OFF
5579
-DOMPL_BUILD_PYBINDINGS=OFF
@@ -64,4 +88,4 @@ jobs:
6488
- name: test
6589
shell: bash
6690
run: |
67-
cmake --build build --config ${{ matrix.build_type }} --target RUN_TESTS
91+
cmake --build build --config ${{ matrix.build_type }} --target ${{ matrix.test_target }}

0 commit comments

Comments
 (0)