-
Notifications
You must be signed in to change notification settings - Fork 599
125 lines (111 loc) · 3.83 KB
/
main.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
125
name: Linux / MacOS - c++
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- test: unit_tests
os: ubuntu-22.04
access: row_major
ensure: default_panic
compiler: clang
- test: unit_tests
os: ubuntu-24.04
access: col_major
ensure: default_panic
compiler: clang
- test: unit_tests
os: ubuntu-22.04
access: col_major
ensure: default_panic
compiler: gcc
- test: unit_tests
os: ubuntu-24.04
access: col_major
ensure: default_panic
compiler: gcc
- test: unit_tests
os: macos-13
access: col_major
ensure: default_panic
compiler: clang
- test: unit_tests
os: macos-14
access: col_major
ensure: default_panic
compiler: clang
- test: install_test
os: ubuntu-22.04
access: col_major
ensure: default_panic
compiler: clang
- test: install_test
os: ubuntu-22.04
access: col_major
ensure: custom_handler
compiler: clang
- test: install_test
os: macos-14
access: col_major
ensure: default_panic
compiler: clang
- test: install_test
os: macos-14
access: col_major
ensure: custom_handler
compiler: clang
fail-fast: false
steps:
- name: Set default value for for environment variables
run: |
echo "ROW_MAJOR_DEFAULT=OFF" >> $GITHUB_ENV
echo "SOPHUS_ENABLE_ENSURE_HANDLER=OFF" >> $GITHUB_ENV
- name: Update ROW_MAJOR_DEFAULT=ON if condition is met
if: matrix.access == 'row_major'
run: echo "ROW_MAJOR_DEFAULT=ON" >> $GITHUB_ENV
- name: Update SOPHUS_ENABLE_ENSURE_HANDLER=ON if condition is met
if: matrix.ensure == 'custom_handler'
run: echo "SOPHUS_ENABLE_ENSURE_HANDLER=ON" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.access }}-${{ matrix.ensure }}-${{ matrix.compiler }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-${{ matrix.access }}-${{ matrix.ensure }}-${{ matrix.compiler }}
- name: Install dependencies (Linux incl. Ceres)
run: ./scripts/install_ubuntu_deps_incl_ceres.sh
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
- name: Install dependencies (Mac OS incl. Ceres)
run: ./scripts/install_osx_deps_incl_ceres.sh
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'
- name: Build (gcc) and run tests
run: ./scripts/run_cpp_tests_gcc.sh
if: matrix.test == 'unit_tests' && matrix.compiler == 'gcc'
- name: Build (clang) and run tests
run: ./scripts/run_cpp_tests_clang.sh
if: matrix.test == 'unit_tests' && matrix.compiler == 'clang'
- name: Install test
run: |
echo "Install test"
mkdir build_dir
cd build_dir
cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -DBUILD_SOPHUS_TESTS=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DSOPHUS_ENABLE_ENSURE_HANDLER=$SOPHUS_ENABLE_ENSURE_HANDLER
# Ubuntu builds via Github actions run on 2-core virtual machines
make -j2
sudo make install
cd ..
cd examples
mkdir build_dir
cd build_dir
cmake ..
make
ls -la
./hello_so3
if: matrix.test == 'install_test'