-
Notifications
You must be signed in to change notification settings - Fork 39
80 lines (75 loc) · 2.18 KB
/
build-and-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
name: build
defaults:
run:
# NOTE: Runners only provide bash (even on macOS).
# NOTE: -i to load the bashrc settings.
shell: bash -ieo pipefail {0}
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
- macos-13
steps:
- uses: actions/checkout@v4
- run: |
# Let homebrew manage python instead of the 3rd party-install.
python_version_number=3.12
sudo rm -rf /Library/Frameworks/Python.framework/Versions/${python_version_number}/
sudo rm -rf "/Applications/Python ${python_version_number}/"
cd /usr/local/bin && ls -l | grep "/Library/Frameworks/Python.framework/Versions/${python_version_number}" | awk '{print $9}' | sudo xargs rm
if: runner.os == 'macOS'
- run: ./bin/bootstrap.sh
- run: |
mkdir build
pushd build
cmake ../
make -j2
popd
- run: ./bin/runtests.sh
- name: Cache build
if: runner.os == 'Linux'
id: cache-build
uses: actions/cache@v4
with:
path: build
key: linux-build-${{ github.sha }}
code-coverage:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Restore build
id: cache-build
uses: actions/cache@v4
with:
path: build
key: linux-build-${{ github.sha }}
- run: sudo apt install lcov
- run: ./bin/gencov.sh
- uses: codecov/codecov-action@v1
with:
files: ./coverage.info
flags: codecoverage
docs:
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: sudo apt install lcov doxygen graphviz python3 python3-pip python3-setuptools
- run: python3 -m pip install coverxygen
- run: ./bin/gendocs.sh
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/html
- uses: codecov/codecov-action@v1
with:
files: ./docs/doc-coverage.info
flags: doccoverage