Skip to content

Commit a00dcea

Browse files
authored
Merge pull request #972 from nipy/ci/github_migration
CI: Migrate to GitHub actions
2 parents a84b203 + 475ae88 commit a00dcea

File tree

15 files changed

+478
-212
lines changed

15 files changed

+478
-212
lines changed

.azure-pipelines/windows.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.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: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: ['REQUIREMENTS']
22+
env:
23+
DEPENDS: ${{ matrix.depends }}
24+
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
25+
INSTALL_TYPE: ${{ matrix.install }}
26+
CHECK_TYPE: ${{ matrix.check }}
27+
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
submodules: recursive
33+
fetch-depth: 0
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
architecture: ${{ matrix.architecture }}
39+
- name: Display Python version
40+
run: python -c "import sys; print(sys.version)"
41+
- name: Create virtual environment
42+
run: tools/ci/create_venv.sh
43+
- name: Build archive
44+
run: |
45+
source tools/ci/build_archive.sh
46+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
47+
- name: Install dependencies
48+
run: tools/ci/install_dependencies.sh
49+
- name: Install NiBabel
50+
run: tools/ci/install.sh
51+
- name: Run tests
52+
run: tools/ci/check.sh
53+
if: ${{ matrix.check != 'skiptests' }}
54+
- uses: codecov/codecov-action@v1
55+
with:
56+
file: for_testing/coverage.xml
57+
if: ${{ always() }}
58+
- name: Upload pytest test results
59+
uses: actions/upload-artifact@v2
60+
with:
61+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
62+
path: for_testing/test-results.xml
63+
if: ${{ always() && matrix.check == 'test' }}

.github/workflows/pre-release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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: ['REQUIREMENTS']
25+
optional-depends: ['DEFAULT_OPT_DEPENDS']
26+
include:
27+
# Pydicom master
28+
- os: ubuntu-latest
29+
python-version: 3.8
30+
install: setup
31+
check: test
32+
pip-flags: ''
33+
depends: REQUIREMENTS
34+
optional-depends: PYDICOM_MASTER
35+
exclude:
36+
- os: ubuntu-latest
37+
architecture: x86
38+
- os: macos-latest
39+
architecture: x86
40+
- os: windows-latest
41+
python-version: 3.9
42+
- os: macos-latest
43+
python-version: 3.9
44+
45+
env:
46+
DEPENDS: ${{ matrix.depends }}
47+
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
48+
INSTALL_TYPE: ${{ matrix.install }}
49+
CHECK_TYPE: ${{ matrix.check }}
50+
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
submodules: recursive
56+
fetch-depth: 0
57+
- name: Set up Python ${{ matrix.python-version }}
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
architecture: ${{ matrix.architecture }}
62+
- name: Display Python version
63+
run: python -c "import sys; print(sys.version)"
64+
- name: Create virtual environment
65+
run: tools/ci/create_venv.sh
66+
- name: Build archive
67+
run: |
68+
source tools/ci/build_archive.sh
69+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
70+
- name: Install dependencies
71+
run: tools/ci/install_dependencies.sh
72+
- name: Install NiBabel
73+
run: tools/ci/install.sh
74+
- name: Run tests
75+
run: tools/ci/check.sh
76+
if: ${{ matrix.check != 'skiptests' }}
77+
- uses: codecov/codecov-action@v1
78+
with:
79+
file: for_testing/coverage.xml
80+
if: ${{ always() }}
81+
- name: Upload pytest test results
82+
uses: actions/upload-artifact@v2
83+
with:
84+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
85+
path: for_testing/test-results.xml
86+
if: ${{ always() && matrix.check == 'test' }}

.github/workflows/stable.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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
8+
9+
on: [push]
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
stable:
17+
# Check each OS, all supported Python, minimum versions and latest releases
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
22+
python-version: [3.6, 3.7, 3.8, 3.9]
23+
architecture: ['x64', 'x86']
24+
install: ['setup']
25+
check: ['test']
26+
pip-flags: ['']
27+
depends: ['REQUIREMENTS']
28+
optional-depends: ['DEFAULT_OPT_DEPENDS']
29+
include:
30+
# Basic dependencies only
31+
- os: ubuntu-latest
32+
python-version: 3.6
33+
install: setup
34+
check: test
35+
pip-flags: ''
36+
depends: REQUIREMENTS
37+
optional-depends: ''
38+
# Absolute minimum dependencies
39+
- os: ubuntu-latest
40+
python-version: 3.6
41+
install: setup
42+
check: test
43+
pip-flags: ''
44+
depends: MIN_REQUIREMENTS
45+
optional-depends: ''
46+
# Absolute minimum dependencies plus old MPL, Pydicom, Pillow
47+
- os: ubuntu-latest
48+
python-version: 3.6
49+
install: setup
50+
check: test
51+
pip-flags: ''
52+
depends: MIN_REQUIREMENTS
53+
optional-depends: MIN_OPT_DEPENDS
54+
# Clean install imports only with package-declared dependencies
55+
- os: ubuntu-latest
56+
python-version: 3.6
57+
install: setup
58+
check: skiptests
59+
pip-flags: ''
60+
depends: ''
61+
# Check all installation methods
62+
- os: ubuntu-latest
63+
python-version: 3.8
64+
install: wheel
65+
check: test
66+
pip-flags: ''
67+
depends: REQUIREMENTS
68+
optional-depends: DEFAULT_OPT_DEPENDS
69+
- os: ubuntu-latest
70+
python-version: 3.8
71+
install: sdist
72+
check: test
73+
pip-flags: ''
74+
depends: REQUIREMENTS
75+
optional-depends: DEFAULT_OPT_DEPENDS
76+
- os: ubuntu-latest
77+
python-version: 3.8
78+
install: archive
79+
check: test
80+
pip-flags: ''
81+
depends: REQUIREMENTS
82+
optional-depends: DEFAULT_OPT_DEPENDS
83+
exclude:
84+
- os: ubuntu-latest
85+
architecture: x86
86+
- os: macos-latest
87+
architecture: x86
88+
env:
89+
DEPENDS: ${{ matrix.depends }}
90+
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
91+
INSTALL_TYPE: ${{ matrix.install }}
92+
CHECK_TYPE: ${{ matrix.check }}
93+
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
94+
95+
steps:
96+
- uses: actions/checkout@v2
97+
with:
98+
submodules: recursive
99+
fetch-depth: 0
100+
- name: Set up Python ${{ matrix.python-version }}
101+
uses: actions/setup-python@v2
102+
with:
103+
python-version: ${{ matrix.python-version }}
104+
architecture: ${{ matrix.architecture }}
105+
- name: Display Python version
106+
run: python -c "import sys; print(sys.version)"
107+
- name: Create virtual environment
108+
run: tools/ci/create_venv.sh
109+
- name: Build archive
110+
run: |
111+
source tools/ci/build_archive.sh
112+
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
113+
- name: Install dependencies
114+
run: tools/ci/install_dependencies.sh
115+
- name: Install NiBabel
116+
run: tools/ci/install.sh
117+
- name: Run tests
118+
run: tools/ci/check.sh
119+
if: ${{ matrix.check != 'skiptests' }}
120+
- uses: codecov/codecov-action@v1
121+
with:
122+
file: for_testing/coverage.xml
123+
if: ${{ always() }}
124+
- name: Upload pytest test results
125+
uses: actions/upload-artifact@v2
126+
with:
127+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
128+
path: for_testing/test-results.xml
129+
if: ${{ always() && matrix.check == 'test' }}

0 commit comments

Comments
 (0)