-
Notifications
You must be signed in to change notification settings - Fork 33
74 lines (64 loc) · 1.92 KB
/
Copy pathunit_test.yml
File metadata and controls
74 lines (64 loc) · 1.92 KB
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
name: Unit Test
on:
push:
branches-ignore:
- 'master'
tags-ignore:
- v*
pull_request:
branches-ignore:
- 'master'
jobs:
build_and_test:
name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./swmm-toolkit
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
activate: ./build-env/Scripts/activate
- os: macos-latest
activate: source ./build-env/bin/activate
- os: ubuntu-latest
activate: source ./build-env/bin/activate
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build wheel
run: |
pip install build
python -m build
- name: Upload Wheel
uses: actions/upload-artifact@v4
with:
name: swmm_toolkit_${{ matrix.os }}
path: ./swmm-toolkit/dist/*.whl
- name: Test wheel
run: |
pip install -r test-requirements.txt
pip install --no-index --find-links=./dist swmm_toolkit
pytest
# Regression test for the Python3_SOABI fallback. Builds with
# NO_STABLE_ABI=1 and runs the ctest suffix guardrail to catch the
# double-dot filename bug (e.g. _solver..so) that occurs when
# CMake's FindPython3 fails to populate Python3_SOABI.
- name: Build + ctest (NO_STABLE_ABI path)
shell: bash
env:
NO_STABLE_ABI: "1"
run: |
pip install cmake swig
cmake -S . -B build_cmake
cmake --build build_cmake --config Release
ctest --test-dir build_cmake --output-on-failure -C Release