8000 CI: Set up build-test-deploy workflow on GHA by effigies · Pull Request #3513 · nipy/nipype · GitHub
[go: up one dir, main page]

Skip to content

CI: Set up build-test-deploy workflow on GHA #3513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CI: Move package build/test into stables tests
  • Loading branch information
effigies committed Sep 21, 2022
commit 8d53b509951045128c2d1148fc6289bf33060c07
68 changes: 0 additions & 68 deletions .github/workflows/package.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff 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 Down Expand 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: github.event_name == 'push' && startsWith(github.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 }}
0