Skip to content

Commit 1d4e2dc

Browse files
committed
CI: Factor into three groups of tests
1 parent f3c2812 commit 1d4e2dc

File tree

4 files changed

+185
-58
lines changed

4 files changed

+185
-58
lines changed

.github/workflows/README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
These files implement NiBabel CI for GitHub actions.
2+
The testing logic is implemented in tools/ci/*.sh, and these files adapt
3+
the generic logic to the details of GH.
4+
5+
Each file should differ only by strategy, and env and steps should be identical.

.github/workflows/misc.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Miscellaneous checks
2+
3+
# This file runs doctests on the documentation and style checks
4+
5+
on: [push]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
misc:
13+
runs-on: 'ubuntu-latest'
14+
continue-on-error: true
15+
strategy:
16+
matrix:
17+
python-version: [3.8]
18+
install: ['setup']
19+
check: ['style', 'doc']
20+
pip-flags: ['']
21+
depends: ['DEFAULT_DEPENDS']
22+
env:
23+
# Options
24+
SETUP_REQUIRES: 'pip setuptools>=30.3.0 wheel'
25+
# Dependencies that should always be installable
26+
DEFAULT_DEPENDS: 'numpy scipy matplotlib pillow pydicom'
27+
REQUIREMENTS: '-r requirements.txt'
28+
# Full advertised range
29+
MIN_REQUIREMENTS: '-r min-requirements.txt'
30+
MIN_REQUIREMENTS_PLUS: '-r min-requirements.txt matplotlib==1.5.3 pydicom==0.9.9 pillow==2.6'
31+
PYDICOM_MASTER: 'numpy git+https://github.com/pydicom/pydicom.git@master'
32+
# Might not find wheels for these
33+
OPTIONAL_DEPENDS: 'h5py indexed_gzip'
34+
PRE_PIP_FLAGS: '--pre --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple'
35+
# Selection
36+
DEPENDS: ${{ matrix.depends }}
37+
INSTALL_TYPE: ${{ matrix.install }}
38+
CHECK_TYPE: ${{ matrix.check }}
39+
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
with:
44+
submodules: recursive
45+
fetch-depth: 0
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v2
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
architecture: ${{ matrix.architecture }}
51+
- name: Display Python version
52+
run: python -c "import sys; print(sys.version)"
53+
- name: Create virtual environment
54+
run: tools/ci/create_env.sh
55+
- name: Build archive
56+
run: |
57+
source tools/ci/build_archive.sh
58+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
59+
- name: Install dependencies
60+
run: tools/ci/install_dependencies.sh
61+
- name: Install NiBabel
62+
run: tools/ci/install.sh
63+
- name: Run tests
64+
run: tools/ci/check.sh
65+
if: ${{ matrix.check != 'skiptests' }}
66+
- uses: codecov/codecov-action@v1
67+
with:
68+
file: for_testing/coverage.xml
69+
if: ${{ always() }}
70+
- name: Upload pytest test results
71+
uses: actions/upload-artifact@v2
72+
with:
73+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
74+
path: for_testing/test-results.xml
75+
if: ${{ always() && matrix.check == 'test' }}

.github/workflows/pre-release.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Pre-release checks
2+
3+
# This file tests against pre-release wheels for dependencies
4+
5+
on: [push]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
pre-release:
13+
# Check pre-releases of dependencies on stable Python
14+
runs-on: ${{ matrix.os }}
15+
continue-on-error: true
16+
strategy:
17+
matrix:
18+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
19+
python-version: [3.8, 3.9]
20+
architecture: ['x64', 'x86']
21+
install: ['setup']
22+
check: ['test']
23+
pip-flags: ['PRE_PIP_FLAGS']
24+
depends: ['DEFAULT_DEPENDS']
25+
include:
26+
# Pydicom master
27+
- os: ubuntu-latest
28+
python-version: 3.8
29+
install: setup
30+
check: test
31+
pip-flags: ''
32+
depends: PYDICOM_MASTER
33+
exclude:
34+
- os: ubuntu-latest
35+
architecture: x86
36+
- os: macos-latest
37+
architecture: x86
38+
- os: windows-latest
39+
python-version: 3.9
40+
- os: macos-latest
41+
python-version: 3.9
42+
43+
env:
44+
# Options
45+
SETUP_REQUIRES: 'pip setuptools>=30.3.0 wheel'
46+
# Dependencies that should always be installable
47+
DEFAULT_DEPENDS: 'numpy scipy matplotlib pillow pydicom'
48+
REQUIREMENTS: '-r requirements.txt'
49+
# Full advertised range
50+
MIN_REQUIREMENTS: '-r min-requirements.txt'
51+
MIN_REQUIREMENTS_PLUS: '-r min-requirements.txt matplotlib==1.5.3 pydicom==0.9.9 pillow==2.6'
52+
PYDICOM_MASTER: 'numpy git+https://github.com/pydicom/pydicom.git@master'
53+
# Might not find wheels for these
54+
OPTIONAL_DEPENDS: 'h5py indexed_gzip'
55+
PRE_PIP_FLAGS: '--pre --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple'
56+
# Selection
57+
DEPENDS: ${{ matrix.depends }}
58+
INSTALL_TYPE: ${{ matrix.install }}
59+
CHECK_TYPE: ${{ matrix.check }}
60+
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
61+
62+
steps:
63+
- uses: actions/checkout@v2
64+
with:
65+
submodules: recursive
66+
fetch-depth: 0
67+
- name: Set up Python ${{ matrix.python-version }}
68+
uses: actions/setup-python@v2
69+
with:
70+
python-version: ${{ matrix.python-version }}
71+
architecture: ${{ matrix.architecture }}
72+
- name: Display Python version
73+
run: python -c "import sys; print(sys.version)"
74+
- name: Create virtual environment
75+
run: tools/ci/create_env.sh
76+
- name: Build archive
77+
run: |
78+
source tools/ci/build_archive.sh
79+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
80+
- name: Install dependencies
81+
run: tools/ci/install_dependencies.sh
82+
- name: Install NiBabel
83+
run: tools/ci/install.sh
84+
- name: Run tests
85+
run: tools/ci/check.sh
86+
if: ${{ matrix.check != 'skiptests' }}
87+
- uses: codecov/codecov-action@v1
88+
with:
89+
file: for_testing/coverage.xml
90+
if: ${{ always() }}
91+
- name: Upload pytest test results
92+
uses: actions/upload-artifact@v2
93+
with:
94+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
95+
path: for_testing/test-results.xml
96+
if: ${{ always() && matrix.check == 'test' }}

.github/workflows/test.yml renamed to .github/workflows/stable.yml

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
name: NiBabel tests
1+
name: Stable tests
2+
3+
# This file tests the claimed support range of NiBabel including
4+
#
5+
# * Operating systems: Linux, Windows (x64 & x86), OSX
6+
# * Dependencies: minimum requirements, optional requirements
7+
# * Installation methods: setup.py, sdist, wheel, archive
28

39
on: [push]
410

@@ -7,9 +13,9 @@ defaults:
713
shell: bash
814

915
jobs:
10-
test:
16+
stable:
17+
# Check each OS, all supported Python, minimum versions and latest releases
1118
runs-on: ${{ matrix.os }}
12-
continue-on-error: ${{ matrix.experimental }}
1319
strategy:
1420
matrix:
1521
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
@@ -20,108 +26,53 @@ jobs:
2026
pip-flags: ['']
2127
depends: ['DEFAULT_DEPENDS']
2228
include:
23-
# Mark Windows experimental but not Linux or OSX
24-
- os: ubuntu-latest
25-
experimental: false
26-
- os: macos-latest
27-
experimental: false
28-
- os: windows-latest
29-
experimental: true
3029
# Basic dependencies only
3130
- os: ubuntu-latest
3231
python-version: 3.6
3332
install: setup
3433
check: test
3534
pip-flags: ''
3635
depends: REQUIREMENTS
37-
experimental: false
3836
# Absolute minimum dependencies
3937
- os: ubuntu-latest
4038
python-version: 3.6
4139
install: setup
4240
check: test
4341
pip-flags: ''
4442
depends: MIN_REQUIREMENTS
45-
experimental: false
4643
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
4744
- os: ubuntu-latest
4845
python-version: 3.6
4946
install: setup
5047
check: test
5148
pip-flags: ''
5249
depends: MIN_REQUIREMENTS_PLUS
53-
experimental: false
5450
# Clean install imports only with package-declared dependencies
5551
- os: ubuntu-latest
5652
python-version: 3.6
5753
install: setup
5854
check: skiptests
5955
pip-flags: ''
6056
depends: ''
61-
experimental: false
6257
# Check all installation methods
6358
- os: ubuntu-latest
6459
python-version: 3.8
6560
install: wheel
6661
check: test
6762
pip-flags: ''
6863
depends: DEFAULT_DEPENDS
69-
experimental: false
7064
- os: ubuntu-latest
7165
python-version: 3.8
7266
install: sdist
7367
check: test
7468
pip-flags: ''
7569
depends: DEFAULT_DEPENDS
76-
experimental: false
7770
- os: ubuntu-latest
7871
python-version: 3.8
7972
install: archive
8073
check: test
8174
pip-flags: ''
8275
depends: DEFAULT_DEPENDS
83-
experimental: false
84-
# Check pre-releases if available
85-
- os: ubuntu-latest
86-
python-version: 3.8
87-
install: setup
88-
check: test
89-
pip-flags: PRE_PIP_FLAGS
90-
depends: DEFAULT_DEPENDS
91-
experimental: true
92-
- os: ubuntu-latest
93-
python-version: 3.9
94-
install: setup
95-
check: test
96-
pip-flags: PRE_PIP_FLAGS
97-
depends: DEFAULT_DEPENDS
98-
experimental: true
99-
- os: macos-latest
100-
python-version: 3.8
101-
install: setup
102-
check: test
103-
pip-flags: PRE_PIP_FLAGS
104-
depends: DEFAULT_DEPENDS
105-
experimental: true
106-
- os: windows-latest
107-
python-version: 3.8
108-
install: setup
109-
check: test
110-
pip-flags: PRE_PIP_FLAGS
111-
depends: DEFAULT_DEPENDS
112-
experimental: true
113-
# Style check
114-
- os: ubuntu-latest
115-
python-version: 3.8
116-
install: setup
117-
check: style
118-
experimental: false
119-
# Documentation doctests
120-
- os: ubuntu-latest
121-
python-version: 3.8
122-
install: setup
123-
check: doc
124-
experimental: false
12576
exclude:
12677
- os: ubuntu-latest
12778
architecture: x86

0 commit comments

Comments
 (0)