-
Notifications
You must be signed in to change notification settings - Fork 769
124 lines (112 loc) · 4.01 KB
/
windows.yml
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
name: Windows
on:
pull_request:
branches:
- "*" # Pull request for all branches
schedule:
- cron: '10 12 * * 0'
# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: vcpkg-windows-${{ matrix.type }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- type: x64
BUILD_DIR: gtsam\3rdparty\vcpkg\cache
VCPKG_ROOT: gtsam\3rdparty\vcpkg\cache\vcpkg
VCPKG_LINK: https://github.com/microsoft/vcpkg/
VCPKG_CONFIGS: gtsam\3rdparty\vcpkg
BINARY_CACHE: gtsam\3rdparty\vcpkg\cache\windows
env:
BUILD_DIR: ${{ matrix.BUILD_DIR }}
VCPKG_ROOT: ${{ matrix.VCPKG_ROOT }}
VCPKG_LINK: ${{ matrix.VCPKG_LINK }}
VCPKG_CONFIGS: ${{ matrix.VCPKG_CONFIGS }}
BINARY_CACHE: ${{ matrix.BINARY_CACHE }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore cache dependencies
uses: actions/cache/restore@v3
with:
path: |
${{ matrix.BINARY_CACHE }}
key: windows-${{ hashFiles('.github/workflows/windows.yml') }}
restore-keys: windows-${{ hashFiles('.github/workflows/windows.yml') }}
- name: Setup msbuild
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install python packages
if: success()
shell: cmd
run: |
choco install python311
where python3.11.exe
:: C:\ProgramData\chocolatey\bin\python3.11.exe -m pip --version
:: C:\ProgramData\chocolatey\bin\python3.11.exe -m pip install pyparsing
- name: Install ninja
if: success()
shell: cmd
run: |
choco install ninja
ninja --version
where ninja
- name: Fix vcpkg
run: vcpkg.exe integrate remove
- name: Init vcpkg
if: success()
shell: cmd
run: |
mkdir -p %BUILD_DIR%
git -C %BUILD_DIR% clone %VCPKG_LINK%
- name: Vcpkg build & cmake config
if: success()
shell: cmd
run: |
set VCPKG_ROOT=${{ matrix.VCPKG_ROOT }}
set VCPKG_BINARY_SOURCES=clear;files,%CD%\%BINARY_CACHE%,readwrite;
mkdir %BINARY_CACHE%
set CMAKE_GENERATOR=Ninja
set CL=-openmp:experimental
cmake . -B build ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_MANIFEST_DIR=%VCPKG_CONFIGS%\manifest ^
-DVCPKG_INSTALLED_DIR=%VCPKG_ROOT%\installed ^
-DVCPKG_OVERLAY_TRIPLETS=%VCPKG_CONFIGS%\triplets ^
-DVCPKG_TARGET_TRIPLET=x64-windows ^
-DVCPKG_INSTALL_OPTIONS=--clean-after-build ^
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON ^
-DGTSAM_ROT3_EXPMAP=ON ^
-DGTSAM_POSE3_EXPMAP=ON ^
-DGTSAM_BUILD_PYTHON=OFF ^
-DGTSAM_BUILD_TESTS=ON ^
-DGTSAM_BUILD_UNSTABLE=OFF ^
-DGTSAM_USE_SYSTEM_EIGEN=ON ^
-DGTSAM_USE_SYSTEM_METIS=ON ^
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON
- name: Save cache dependencies
id: cache-save
uses: actions/cache/save@v3
with:
path: |
${{ matrix.BINARY_CACHE }}
key: windows-${{ hashFiles('.github/workflows/windows.yml') }}-${{ hashFiles('gtsam\3rdparty\vcpkg\cache\vcpkg\installed\vcpkg\updates\*') }}
- name: Cmake build
if: success()
shell: cmd
run: |
cmake --build build --config Release -j 2
- name: Run tests
if: success()
shell: cmd
run: |
:: Tests compile for windows and some of them fail. Need to be fixed and can remove this comments.
cmake --build build --target check -j 1