-
Notifications
You must be signed in to change notification settings - Fork 1
170 lines (146 loc) · 4.71 KB
/
macos.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: macOS
on: [push, pull_request]
jobs:
build-native:
name: ${{matrix.os}}-AppleClang-${{matrix.build_type}}
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os:
- macos-13
- macos-14
- macos-15
build_type:
- Release
- Debug
steps:
- uses: actions/checkout@v4
- name: Setup Dependencies
run: |
brew install \
boost \
eigen \
fmt \
ninja \
opencv \
python
python -m venv .env/
source .env/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
pip install -r requirements.txt
- name: Setup Debug Environment
if: ${{matrix.build_type == 'Debug'}}
run: |
echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV
echo 'LDFLAGS=--coverage' >> $GITHUB_ENV
- name: Setup Environment
run: |
echo "pybind11_ROOT=$(pybind11-config --cmakedir)" >> $GITHUB_ENV
- name: Configure
env:
CXXFLAGS: -Weverything -Wno-c++98-compat -Wno-padded -Wno-c++98-compat-pedantic -Wno-disabled-macro-expansion -Wno-shadow -Wno-used-but-marked-unused -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-poison-system-directories -Werror ${{env.CXXFLAGS}}
Python_ROOT: ${{github.workspace}}/.env/
run: |
cmake -S . -B build/ \
-DCMAKE_REQUIRE_FIND_PACKAGE_pybind11=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_Python=ON \
-DCMAKE_REQUIRE_FIND_PACKAGE_Sphinx=ON \
-G Xcode
- name: Build
run: |
cmake --build build/ \
--config ${{matrix.build_type}}
- name: Test
run: |
ctest --test-dir build/ \
--build-config ${{matrix.build_type}} \
-j$(sysctl -n hw.ncpu) \
--output-on-failure
- name: Generate Documentation
run: |
cmake --build build/ \
--config ${{matrix.build_type}} \
--target sphinx
- name: Generate Coverage
if: matrix.build_type == 'Debug'
run: |
cd build/
gcovr -r .. . -s --cobertura coverage.xml
- name: Upload Coverage to Codecov
if: ${{matrix.build_type == 'Debug'}}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage.xml
fail_ci_if_error: true
verbose: true
build-wheel:
name: Python-${{matrix.python}}-${{matrix.build_type}}-wheel
runs-on: macos-15
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
build_type:
- Release
- Debug
python:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- 'pypy3.10'
steps:
- uses: actions/checkout@v4
- name: Setup Dependencies
run: |
brew install \
eigen \
fmt
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
cache: 'pip'
cache-dependency-path: requirements.txt
- name: Setup Dependencies
run: |
pip install -r requirements.txt
- name: Setup Environment
run: |
echo 'Eigen3_ROOT=${{github.workspace}}/eigen' >> $GITHUB_ENV
echo 'fmt_ROOT=${{github.workspace}}/fmt' >> $GITHUB_ENV
echo "pybind11_ROOT=$(pybind11-config --cmakedir)" >> $GITHUB_ENV
- name: Build
env:
CXXFLAGS: -Weverything -Wno-c++98-compat -Wno-padded -Wno-c++98-compat-pedantic -Wno-disabled-macro-expansion -Wno-shadow -Wno-used-but-marked-unused -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-poison-system-directories -Werror ${{env.CXXFLAGS}}
run: |
pip install --no-build-isolation \
--config-settings build-dir=build/ \
--config-settings cmake.build-type=${{matrix.build_type}} \
--verbose \
--editable .
- name: Test
run: |
coverage run -m pytest --junit-xml=report.xml
- name: Generate Documentation
run: |
sphinx-build -M html docs/ docs/_build -W --keep-going
- name: Generate Coverage
run: |
coverage report
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
verbose: true