-
Notifications
You must be signed in to change notification settings - Fork 11
78 lines (67 loc) · 2.11 KB
/
unit-tests-ci.yaml
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
name: build
on:
push:
branches:
- "main"
- "dev"
pull_request:
branches:
- "main"
- "dev"
jobs:
test:
name: Test Python ${{ matrix.python-version }}, ${{ matrix.os }}, ${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
# mpi: [ 'mpich', 'openmpi', 'intelmpi']
# mpi: ['openmpi']
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 2
# Install MPI (required to build mpi4py)
# see: https://github.com/mpi4py/setup-mpi
# - name: Setup MPI
# uses: mpi4py/setup-mpi@v1
# with:
# mpi: ${{ matrix.mpi }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# - if: matrix.os == 'ubuntu-latest'
# # need to update cache to find packages, see https://github.com/nektos/act/issues/588#issuecomment-809479520
# run: sudo apt-get update
# run: sudo apt-get install libopenmpi-dev
# - if: matrix.os == 'macOS-latest'
# run: |
# brew install mpich
- name: Install dependencies
run: |
which python
python --version
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Install package
run: |
python setup.py build_ext -i
python setup.py develop
- name: Report environment information
run: |
which python
python --version
python -c "import sys; print(f'Python {sys.version}')"
python -c "import pip; print(f'pip {pip.__version__}')"
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')"
python -m pip freeze
which tox
tox --version
- name: Run pytest via tox
# Run tox using the version of Python in `PATH` by using the `-e py` argument
run: |
tox -e py