Skip to content

Commit e28e556

Browse files
authored
Merge pull request #3513 from effigies/ci/build-test-deploy
CI: Set up build-test-deploy workflow on GHA
2 parents e5be008 + c005bdb commit e28e556

File tree

6 files changed

+89
-69
lines changed

6 files changed

+89
-69
lines changed

.github/workflows/contrib.yml

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ defaults:
1818
run:
1919
shell: bash
2020

21+
concurrency:
22+
group: contrib-${{ github.ref }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
stable:
2327
# Check each OS, all supported Python, minimum versions and latest releases

.github/workflows/package.yml

-64
This file was deleted.

.github/workflows/tests.yml

+68-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,59 @@ defaults:
2323
run:
2424
shell: bash
2525

26+
concurrency:
27+
group: tests-${{ github.ref }}
28+
cancel-in-progress: true
29+
2630
jobs:
31+
build:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
with:
36+
fetch-depth: 0
37+
- uses: actions/setup-python@v4
38+
with:
39+
python-version: 3
40+
- run: pip install --upgrade build twine
41+
- name: Build sdist and wheel
42+
run: python -m build
43+
- run: twine check dist/*
44+
- uses: actions/upload-artifact@v3
45+
with:
46+
name: dist
47+
path: dist/
48+
49+
test-package:
50+
runs-on: ubuntu-latest
51+
needs: [build]
52+
strategy:
53+
matrix:
54+
package: ['wheel', 'sdist']
55+
steps:
56+
- uses: actions/download-artifact@v3
57+
with:
58+
name: dist
59+
path: dist/
60+
- uses: actions/setup-python@v4
61+
with:
62+
python-version: 3
63+
- name: Display Python version
64+
run: python -c "import sys; print(sys.version)"
65+
- name: Update pip
66+
run: pip install --upgrade pip
67+
- name: Install wheel
68+
run: pip install dist/nipype-*.whl
69+
if: matrix.package == 'wheel'
70+
- name: Install sdist
71+
run: pip install dist/nipype-*.tar.gz
72+
if: matrix.package == 'sdist'
73+
- run: python -c 'import nipype; print(nipype.__version__)'
74+
- name: Install test extras
75+
run: pip install nipype[tests]
76+
- name: Run tests
77+
run: pytest --doctest-modules -v --pyargs nipype
78+
2779
stable:
2880
# Check each OS, all supported Python, minimum versions and latest releases
2981
runs-on: ${{ matrix.os }}
@@ -55,9 +107,6 @@ jobs:
55107

56108
steps:
57109
- uses: actions/checkout@v3
58-
with:
59-
submodules: recursive
60-
fetch-depth: 0
61110
- name: Set up Python ${{ matrix.python-version }}
62111
uses: actions/setup-python@v4
63112
with:
@@ -72,7 +121,7 @@ jobs:
72121
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
73122
- name: Install Debian dependencies
74123
run: tools/ci/install_deb_dependencies.sh
75-
if: ${{ matrix.os == 'ubuntu-18.04' }}
124+
if: ${{ matrix.os == 'ubuntu-latest' }}
76125
- name: Install dependencies
77126
run: tools/ci/install_dependencies.sh
78127
- name: Install Nipype
@@ -90,3 +139,18 @@ jobs:
90139
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
91140
path: test-results.xml
92141
if: ${{ always() && matrix.check == 'test' }}
142+
143+
publish:
144+
runs-on: ubuntu-latest
145+
environment: "Package deployment"
146+
needs: [stable, test-package]
147+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
148+
steps:
149+
- uses: actions/download-artifact@v3
150+
with:
151+
name: dist
152+
path: dist/
153+
- uses: pypa/gh-action-pypi-publish@release/v1
154+
with:
155+
user: __token__
156+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tutorials.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- 'rel/*'
77

8+
concurrency:
9+
group: tutorials-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
tutorial:
1014
runs-on: ubuntu-latest

nipype/info.py

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def get_nipype_gitversion():
157157
"pytest-cov",
158158
"pytest-env",
159159
"pytest-timeout",
160+
"pytest-doctestplus",
161+
"sphinx",
160162
]
161163

162164
EXTRA_REQUIRES = {

tools/ci/install_deb_dependencies.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ set -eu
66

77
echo "INSTALL_DEB_DEPENDENCIES = $INSTALL_DEB_DEPENDENCIES"
88

9+
DEPS=(
10+
fsl
11+
# afni
12+
# elastix
13+
fsl-atlases
14+
xvfb
15+
fusefat
16+
graphviz
17+
)
18+
919
if $INSTALL_DEB_DEPENDENCIES; then
1020
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
1121
sudo apt update
12-
sudo apt install -y -qq fsl afni elastix fsl-atlases xvfb fusefat graphviz
22+
sudo apt install -y -qq ${DEPS[@]}
1323
fi

0 commit comments

Comments
 (0)