-
Notifications
You must be signed in to change notification settings - Fork 28
63 lines (53 loc) · 1.48 KB
/
unit_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
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-2022, macos-12, ubuntu-latest]
include:
- os: windows-2022
sys_pkgs: choco install swig
activate: ./build-env/Scripts/activate
- os: macos-12
sys_pkgs: brew install swig ninja
activate: source ./build-env/bin/activate
- os: ubuntu-latest
activate: source ./build-env/bin/activate
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install required system packages
run: ${{matrix.sys_pkgs}}
- name: Build wheel in virtual env
run: |
python -m venv --clear ./build-env
${{matrix.activate}}
python -m pip install -r build-requirements.txt
python setup.py bdist_wheel
deactivate
- name: Test wheel
run: |
pip install -r test-requirements.txt
pip install --no-index --find-links=./dist swmm_toolkit
pytest