-
Notifications
You must be signed in to change notification settings - Fork 4
111 lines (100 loc) · 4.03 KB
/
test.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
name: Test
on: [push, pull_request]
jobs:
cargo-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Run cargo fmt
run: cargo +stable fmt --all --check
cargo-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: cargo clippy
run: cargo +stable clippy --all-targets --workspace --no-default-features --features source -- -Dwarnings
ceres-built-from-source:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Help needed for windows, I don't know why this error appears and how to fix it:
# glog/log_severity.h(57): fatal error C1189: #error: ERROR macro is defined. Define
# GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
os: ["ubuntu-latest", "macos-latest"]
rust_toolchain: ["1.57", "stable"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Cmake on Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends cmake
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
- name: Check workspace
run: cargo +${{ matrix.rust_toolchain }} check --all-targets --workspace --features source
- name: Test ceres-solver
run: cargo +${{ matrix.rust_toolchain }} test --features source
- name: Test ceres-solver-sys
# Doesn't work for now due to linking issues
if: ${{ runner.os != 'Linux' }}
run: cargo +${{ matrix.rust_toolchain }} test --features source
working-directory: ceres-solver-sys
system-ceres:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Help needed for Windows, vcpkg builds it, but I don't know how to make it discoverable
os: [ "ubuntu-latest", "macos-latest" ]
rust_toolchain: [ "1.57", "stable" ]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ceres on Linux
if: ${{ runner.os == 'Linux' }}
# It would be better to use apt-get, but ceres-solver 2.2 comes only in Ubuntu 24.04
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install ceres-solver
echo "LD_LIBRARY_PATH=$(brew --prefix)/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "C_INCLUDE_PATH=$(brew --prefix)/include:$(brew --prefix)/include/eigen3:$C_INCLUDE_PATH" >> $GITHUB_ENV
echo "CPATH=$(brew --prefix)/include:$(brew --prefix)/include/eigen3:$CPATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=$(brew --prefix)/lib:$LIBRARY_PATH" >> $GITHUB_ENV
- name: Install ceres on macOS
if: ${{ runner.os == 'macOS' }}
run: brew install ceres-solver
# Not actually used for now, see reasons above
- name: Install ceres on Windows
if: ${{ runner.os == 'Windows' }}
run: vcpkg install ceres:x64-windows
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
- name: Check ceres-solver
run: cargo +${{ matrix.rust_toolchain }} check --all-targets --features system
- name: Check ceres-solver-sys
run: cargo +${{ matrix.rust_toolchain }} check --all-targets --features system
working-directory: ceres-solver-sys
- name: Test ceres-solver
run: cargo +${{ matrix.rust_toolchain }} test --features system
- name: Test ceres-solver-sys
# Doesn't work on Linux for now due to linking issues
if: ${{ runner.os != 'Linux' }}
run: cargo +${{ matrix.rust_toolchain }} test --features system
working-directory: ceres-solver-sys