Skip to content

Commit ea9d043

Browse files
committed
Use vcpkg manifest
1 parent 2cd0a7c commit ea9d043

File tree

1 file changed

+10
-36
lines changed

1 file changed

+10
-36
lines changed

.github/workflows/vcpkg.yml

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
uses: actions/cache/restore@v3
4949
with:
5050
path: ${{ matrix.binary_cache }}
51-
key: ${{ matrix.os }}
52-
restore-keys: ${{ matrix.os }}
51+
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
52+
restore-keys: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
5353

5454
- name: Setup msbuild
5555
if: runner.os == 'Windows'
@@ -85,34 +85,8 @@ jobs:
8585
run: |
8686
brew install autoconf autoconf-archive automake libtool
8787
88-
- name: Set vcpkg installtion root env
89-
shell: bash
90-
run: |
91-
VCPKG_BASH_PATH=${VCPKG_INSTALLATION_ROOT//\\//}
92-
echo "VCPKG_INSTALLATION_ROOT=$VCPKG_BASH_PATH" >> "$GITHUB_ENV"
93-
9488
- name: "Install dependencies"
95-
run: >
96-
vcpkg x-set-installed --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
97-
boost-assign
98-
boost-bimap
99-
boost-chrono
100-
boost-date-time
101-
boost-filesystem
102-
boost-format
103-
boost-graph
104-
boost-math
105-
boost-program-options
106-
boost-regex
107-
boost-serialization
108-
boost-system
109-
boost-thread
110-
boost-timer
111-
tbb
112-
pybind11
113-
geographiclib
114-
eigen3
115-
${{ matrix.additional_vcpkg_ports }}
89+
run: vcpkg install --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
11690

11791
- name: On Failure, upload vcpkg logs
11892
if: failure()
@@ -125,9 +99,8 @@ jobs:
12599
- name: copy files for hash
126100
shell: bash
127101
run: |
128-
echo $VCPKG_INSTALLATION_ROOT
129102
mkdir -p vcpkg-info
130-
find $VCPKG_INSTALLATION_ROOT/installed/ -type f -name 'vcpkg_abi_info.txt' | \
103+
find vcpkg_installed/ -type f -name 'vcpkg_abi_info.txt' | \
131104
while read filepath; do
132105
triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}')
133106
port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}')
@@ -136,17 +109,18 @@ jobs:
136109
137110
- name: Save cache dependencies
138111
# Don't save if it's the exact same
139-
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}', matrix.os, hashFiles('vcpkg-info/*'))
112+
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}-{2}', matrix.os, hashFiles('vcpkg.json'), hashFiles('vcpkg-info/*'))
140113
uses: actions/cache/save@v4
141114
with:
142115
path: ${{ matrix.binary_cache }}
143-
key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }}
116+
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}-${{ hashFiles('vcpkg-info/*') }}
144117

145118
- name: Install python packages
146119
shell: bash
147120
run: |
148-
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
149-
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
121+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
122+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
123+
ls vcpkg_installed/${{ matrix.triplet }}/tools/python3/Lib/site-packages/
150124
151125
- name: Set Swap Space (Linux)
152126
if: runner.os == 'Linux'
@@ -162,7 +136,7 @@ jobs:
162136
163137
cmake . -B build -G Ninja \
164138
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
165-
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
139+
-DVCPKG_INSTALLED_DIR=$RUNNER_WORKSPACE/vcpkg_installed \
166140
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
167141
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
168142
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \

0 commit comments

Comments
 (0)