forked from borglab/gtsam
-
Notifications
You must be signed in to change notification settings - Fork 0
194 lines (174 loc) · 6.58 KB
/
vcpkg.yml
File metadata and controls
194 lines (174 loc) · 6.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: vcpkg
on:
pull_request:
push:
# Runs on pushes targeting the develop branch
branches: [develop]
# Cancels any in-progress workflow runs for the same PR when a new push is made,
# allowing the runner to become available more quickly for the latest changes.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows-release
build_type: Release
test_target: RUN_TESTS
binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives
python: python
# Exclude test_sumProduct and test_sumProduct_chain from pytest on windows.
# These tests should be fixed for windows.
pytest_extra_flags: -k "not test_sumProduct"
- os: ubuntu-latest
triplet: x64-linux-release
build_type: Release
test_target: test
binary_cache: /home/runner/.cache/vcpkg/archives
python: python3
- os: macos-latest
triplet: arm64-osx-release
build_type: Release
test_target: test
binary_cache: /Users/runner/.cache/vcpkg/archives
python: python3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache dependencies
id: cache-restore
uses: actions/cache/restore@v3
with:
path: ${{ matrix.binary_cache }}
key: ${{ matrix.os }}
restore-keys: ${{ matrix.os }}
- name: Setup msbuild
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: 14.40
- name: Install sccache
if: runner.os == 'Windows'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Use sccache
if: runner.os == 'Windows'
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=ON" >> "$GITHUB_ENV"
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
- name: cl version
if: runner.os == 'Windows'
shell: cmd
run: cl
- name: Install vcpkg python dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install autoconf automake autoconf-archive
- name: Install vcpkg python dependencies
if: runner.os == 'macOS'
shell: bash
run: |
brew install autoconf autoconf-archive automake libtool
- name: Set vcpkg installtion root env
shell: bash
run: |
VCPKG_BASH_PATH=${VCPKG_INSTALLATION_ROOT//\\//}
echo "VCPKG_INSTALLATION_ROOT=$VCPKG_BASH_PATH" >> "$GITHUB_ENV"
- name: "Install dependencies"
run: >
vcpkg x-set-installed --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
boost-assign
boost-bimap
boost-chrono
boost-date-time
boost-filesystem
boost-format
boost-graph
boost-math
boost-program-options
boost-regex
boost-serialization
boost-system
boost-thread
boost-timer
tbb
pybind11
- name: On Failure, upload vcpkg logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs_${{ matrix.os }}_${{ github.event.pull_request.head.sha }}
path: |
${{ env.VCPKG_INSTALLATION_ROOT }}/buildtrees/**/*.log
- name: copy files for hash
shell: bash
run: |
echo $VCPKG_INSTALLATION_ROOT
mkdir -p vcpkg-info
find $VCPKG_INSTALLATION_ROOT/installed/ -type f -name 'vcpkg_abi_info.txt' | \
while read filepath; do
triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}')
port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}')
cp "$filepath" "vcpkg-info/${triplet}_${port}.txt"
done
- name: Save cache dependencies
# Don't save if it's the exact same
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}', matrix.os, hashFiles('vcpkg-info/*'))
uses: actions/cache/save@v4
with:
path: ${{ matrix.binary_cache }}
key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }}
- name: Install python packages
shell: bash
run: |
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
- name: cmake config
if: success()
shell: bash
run: |
export CL=-openmp
cmake . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
-DGTSAM_BUILD_WITH_PRECOMPILED_HEADERS=OFF \
-DGTSAM_ROT3_EXPMAP=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_BUILD_PYTHON=ON \
-DGTSAM_BUILD_TESTS=ON \
-DGTSAM_BUILD_UNSTABLE=ON \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=OFF \
-DGTSAM_USE_SYSTEM_METIS=OFF \
-DGTSAM_USE_SYSTEM_PYBIND=ON \
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON \
-DCTEST_EXTRA_ARGS='${{ matrix.ctest_extra_flags }}' \
-DPYTEST_EXTRA_ARGS='${{ matrix.pytest_extra_flags }}'
- name: cmake build
shell: bash
run: |
cmake --build build --config ${{ matrix.build_type }}
- name: Run Python tests
shell: bash
run: |
export PATH="$PATH:$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/bin"
cmake --build build --target python-install
cmake --build build --target python-test
cmake --build build --target python-test-unstable
- name: Run tests
shell: bash
run: |
cmake --build build --config ${{ matrix.build_type }} --target check