-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (65 loc) · 2.5 KB
/
tests.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
name: Tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
# https://numpy.org/neps/nep-0029-deprecation_policy.html
numpy-version: ['1.22', 'latest', 'dev']
exclude:
- python-version: '3.12'
numpy-version: '1.22'
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
set -x
set -e
python -m pip install -r requirements-dev.txt
if [[ ${{ matrix.numpy-version }} == 'latest' ]]; then
python -m pip install --upgrade numpy
elif [[ ${{ matrix.numpy-version }} == 'dev' ]]; then
python -m pip install --pre --upgrade --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy -r requirements-dev.txt
else
python -m pip install --upgrade numpy==${{ matrix.numpy-version }}.*
fi
- name: Run Doctests
run: |
./run_doctests
# A NumPy 2.0 compatible skimage doesn't support 3.9, and we need a
# version of matplotlib that requires NumPy 1.23. Easiest to just
# skip this for now.
if: matrix.numpy-version != 'dev' && matrix.python-version != '3.9' && matrix.numpy-version != '1.22'
- name: Test Installation
run: |
python -m pip install .
- name: Run Slotscheck
run: |
python -m slotscheck ndindex
# Enable experimental faster sys.monitoring coverage for Python 3.12
- name: Set COVERAGE_CORE=sysmon
run: echo "COVERAGE_CORE=sysmon" >> $GITHUB_ENV
if: matrix.python-version == 3.12
- name: Run Tests
run: |
set -x
set -e
python -We:invalid -We::SyntaxWarning -m compileall -f -q ndindex/
# The coverage requirement check is done by the coverage report line below
PYTEST_FLAGS="$PYTEST_FLAGS -v --cov-fail-under=0";
pytest $PYTEST_FLAGS
# Coverage. This also sets the failing status if the
# coverage is not 100%. Travis sometimes cuts off the last command, which is
# why we print stuff at the end.
if ! coverage report -m; then
echo "Coverage failed";
false;
else
echo "Coverage passed";
fi;