@@ -23,7 +23,59 @@ defaults:
2323 run :
2424 shell : bash
2525
26+ concurrency :
27+ group : tests-${{ github.ref }}
28+ cancel-in-progress : true
29+
2630jobs :
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 }}
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 :
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 }}
0 commit comments