-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (62 loc) · 1.81 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
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 test/test_wrapper_generation.py
- name: Generate new wrappers
run: |
cd examples/shapes/wrapper
rm -rf geometry math_funcs primitives
cd ..
cppwg src/cpp \
--wrapper_root wrapper/ \
--package_info wrapper/package_info.yaml \
--includes src/cpp/*/ \
--std c++17 \
--logfile cppwg.log
- name: Check for new classes
run: |
cd examples/shapes
cat cppwg.log | grep "Unknown class"
- 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