-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (84 loc) · 2.8 KB
/
build-test-deploy.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
name: Build, test and deploy
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
jobs:
build-test-deploy:
strategy:
matrix:
include:
- {os: "ubuntu-20.04", cc: "gcc", cxx: "g++-10"}
- {os: "ubuntu-20.04", cc: "clang", cxx: "clang++"}
- {os: "macos-12", cc: "gcc", cxx: "g++-11"}
- {os: "macos-12", cc: "clang", cxx: "clang++"}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Eigen 3
run: |
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
sudo apt-get update -q
sudo apt-get install libeigen3-dev
else
brew update
brew install eigen
fi
- name: Set up Python 3.8
if: startsWith(matrix.cxx, 'clang')
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install cppcheck
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install cppcheck
- name: Install Sphinx and Read the Docs Sphinx Theme
if: startsWith(matrix.cxx, 'clang')
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme myst-parser
- name: Build libcommute
run: |
mkdir installed
mkdir build && cd build
if [[ "${{ matrix.os }}" == ubuntu* ]]; then
STATIC_ANALYSIS=ON
else
STATIC_ANALYSIS=OFF
fi
if [[ "${{ matrix.cxx }}" == clang* ]]; then
DOCS=ON
else
DOCS=OFF
fi
CXX="${{ matrix.cxx }}" cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/installed \
-DCMAKE_CXX_FLAGS="-march=native" \
-DSTATIC_ANALYSIS=${STATIC_ANALYSIS} \
-DTESTS=ON \
-DEXAMPLES=ON \
-DDOCUMENTATION=${DOCS}
make -j3 VERBOSE=1
- name: Test libcommute
run: |
cd ${GITHUB_WORKSPACE}/build
CTEST_OUTPUT_ON_FAILURE=1 make test
- name: Install libcommute
run: |
cd ${GITHUB_WORKSPACE}/build
make install
- name: Deploy documentation
if: |
github.ref == 'refs/heads/master' &&
startsWith(matrix.os, 'ubuntu') &&
startsWith(matrix.cxx, 'clang')
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
folder: installed/share/doc/libcommute