Skip to content

Commit 2530ca4

Browse files
committed
Use vcpkg manifest
1 parent b0dee96 commit 2530ca4

File tree

2 files changed

+41
-37
lines changed

2 files changed

+41
-37
lines changed

.github/workflows/vcpkg.yml

Lines changed: 11 additions & 37 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,17 @@ 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
150123
151124
- name: Set Swap Space (Linux)
152125
if: runner.os == 'Linux'
@@ -162,7 +135,8 @@ jobs:
162135
163136
cmake . -B build -G Ninja \
164137
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
165-
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
138+
-DVCPKG_INSTALLED_DIR=$RUNNER_WORKSPACE/vcpkg_installed \
139+
-DPython_ROOT_DIR=vcpkg_installed/${{ matrix.triplet }}/tools/python3 \
166140
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
167141
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
168142
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
@@ -192,7 +166,7 @@ jobs:
192166
- name: Run Python tests
193167
shell: bash
194168
run: |
195-
export PATH="$PATH:$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/bin"
169+
export PATH="$PATH:$RUNNER_WORKSPACE/vcpkg_installed/${{ matrix.triplet }}/bin"
196170
cmake --build build --target python-install
197171
cmake --build build --target python-test
198172
cmake --build build --target python-test-unstable

vcpkg.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"dependencies": [
3+
"boost-concept-check",
4+
"boost-fusion",
5+
"boost-graph",
6+
"boost-move",
7+
"boost-optional",
8+
"boost-phoenix",
9+
"boost-pool",
10+
"boost-program-options",
11+
"boost-random",
12+
"boost-range",
13+
"boost-serialization",
14+
"boost-smart-ptr",
15+
"boost-spirit",
16+
"boost-thread",
17+
"boost-timer",
18+
"boost-tokenizer",
19+
"boost-type-traits",
20+
{
21+
"name": "intel-mkl",
22+
"platform": "windows,linux"
23+
},
24+
"tbb",
25+
"pybind11",
26+
"geographiclib",
27+
"eigen3"
28+
],
29+
"builtin-baseline": "84bab45d415d22042bd0b9081aea57f362da3f35"
30+
}

0 commit comments

Comments
 (0)