@@ -23,7 +23,59 @@ defaults:
23
23
run :
24
24
shell : bash
25
25
26
+ concurrency :
27
+ group : tests-${{ github.ref }}
28
+ cancel-in-progress : true
29
+
26
30
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
+
27
79
stable :
28
80
# Check each OS, all supported Python, minimum versions and latest releases
29
81
runs-on : ${{ matrix.os }}
55
107
56
108
steps :
57
109
- uses : actions/checkout@v3
58
- with :
59
- submodules : recursive
60
- fetch-depth : 0
61
110
- name : Set up Python ${{ matrix.python-version }}
62
111
uses : actions/setup-python@v4
63
112
with :
72
121
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
73
122
- name : Install Debian dependencies
74
123
run : tools/ci/install_deb_dependencies.sh
75
- if : ${{ matrix.os == 'ubuntu-18.04 ' }}
124
+ if : ${{ matrix.os == 'ubuntu-latest ' }}
76
125
- name : Install dependencies
77
126
run : tools/ci/install_dependencies.sh
78
127
- name : Install Nipype
@@ -90,3 +139,18 @@ jobs:
90
139
name : pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
91
140
path : test-results.xml
92
141
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 }}
0 commit comments