Merged
Show file tree
Hide file tree
Changes from 1 commit
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Failed to load files.
PrevPrevious commit
Next Next commit
CI: Move package build/test into stables tests
  • Loading branch information
@effigies
effigies committedSep 21, 2022
commit 8d53b509951045128c2d1148fc6289bf33060c07
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,6 +28,54 @@ concurrency:
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3
- run: pip install --upgrade build twine
- name: Build sdist and wheel
run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

test-package:
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
package: ['wheel', 'sdist']
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- uses: actions/setup-python@v4
with:
python-version: 3
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Update pip
run: pip install --upgrade pip
- name: Install wheel
run: pip install dist/nipype-*.whl
if: matrix.package == 'wheel'
- name: Install sdist
run: pip install dist/nipype-*.tar.gz
if: matrix.package == 'sdist'
- run: python -c 'import nipype; print(nipype.__version__)'
- name: Install test extras
run: pip install nipype[tests]
- name: Run tests
run: pytest --doctest-modules -v --pyargs nipype

stable:
# Check each OS, all supported Python, minimum versions and latest releases
runs-on: ${{ matrix.os }}
Expand DownExpand Up@@ -94,3 +142,18 @@ jobs:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: test-results.xml
if: ${{ always() && matrix.check == 'test' }}

publish:
runs-on: ubuntu-latest
environment: "Package deployment"
needs: [stable, test-package]
if: .event_name == 'push' && startsWith(.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}