-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (57 loc) · 1.64 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
name: build-and-test
on:
workflow_dispatch:
pull_request:
branches:
- "**"
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
concurrency:
group: build-and-test-${{ github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install cmake
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install cppwg
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Lint with flake8
run: python -m flake8
- name: Test wrapper generation
run: python -m unittest tests/test_shapes.py
- name: Generate new wrappers
run: |
cd examples/shapes/wrapper
rm -rf geometry math_funcs primitives
cd ..
cppwg src/ \
--wrapper_root wrapper/ \
--package_info wrapper/package_info.yaml \
--includes src/*/ \
--std c++17
- name: Build Python module
run: |
cd examples/shapes
mkdir build
cd build
cmake ..
make -j $(nproc)
- name: Test built module
run: |
cd examples/shapes/build
python -m unittest test_functions.py
python -m unittest test_classes.py