-
Notifications
You must be signed in to change notification settings - Fork 920
161 lines (144 loc) · 5.49 KB
/
vcpkg.yml
File metadata and controls
161 lines (144 loc) · 5.49 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
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 }}
env:
SCCACHE_GHA_ENABLED: 1
# Some files take so long to compile that the sccache daemon times out,
# which is bad for stats tracking. Always keep sccache daemon alive.
SCCACHE_IDLE_TIMEOUT: 0
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows-release
build_type: Release
test_target: RUN_TESTS
python: python
- os: ubuntu-latest
triplet: x64-linux-release
build_type: Release
test_target: test
python: python3
- os: macos-latest
triplet: arm64-osx-release
build_type: Release
test_target: test
python: python3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: 14.40
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.9
- 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 up vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
env:
VCPKG_BINARY_SOURCES: default,rw
- name: Restore cache dependencies
id: cache-restore
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
restore-keys: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
- name: Set Swap Space (Linux)
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 7
- name: cmake config
shell: bash
run: |
cmake -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DVCPKG_INSTALLED_DIR=$GITHUB_WORKSPACE/vcpkg_installed \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
-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=ON \
-DGTSAM_USE_SYSTEM_METIS=OFF \
-DGTSAM_USE_SYSTEM_PYBIND=ON \
-DGTSAM_ENABLE_GEOGRAPHICLIB=ON \
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON \
-DGTSAM_WITH_EIGEN_MKL=ON \
-DGTSAM_WITH_EIGEN_MKL_OPENMP=ON \
-DCTEST_EXTRA_ARGS='${{ matrix.ctest_extra_flags }}' \
-DPYTEST_EXTRA_ARGS='${{ matrix.pytest_extra_flags }}'
- 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: vcpkg/buildtrees/**/*.log
- name: Cache dependencies
# Don't save if it's the exact same
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}-{2}', matrix.os, hashFiles('vcpkg.json'), hashFiles('vcpkg_installed/**/vcpkg_abi_info.txt'))
uses: actions/cache/save@v4
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}-${{ hashFiles('vcpkg_installed/**/vcpkg_abi_info.txt') }}
- name: Install python packages
shell: bash
run: |
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
- name: cmake build
shell: bash
run: |
cmake --build build
- name: Run Python tests
shell: bash
run: |
export PATH="$PATH:$GITHUB_WORKSPACE/vcpkg_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 --target check