Skip to content

Commit

Permalink
chore(ci): Run GHA with tox
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 18, 2024
1 parent cb32982 commit 0aafdfc
Showing 1 changed file with 47 additions and 76 deletions.
123 changes: 47 additions & 76 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
name: Stable tests

# This file tests the claimed support range of nipype including
#
# * Operating systems: Linux, OSX
# * Dependencies: minimum requirements, optional requirements
# * Installation methods: setup.py, sdist, wheel, archive
name: Tox

on:
push:
branches:
- master
- maint/*
tags:
- "*"
branches: [ master, main, 'maint/*' ]
tags: [ '*' ]
pull_request:
branches:
- master
- maint/*
branches: [ master, main, 'maint/*' ]
schedule:
# 8am EST / 9am EDT Mondays
- cron: "0 13 * * 1"
Expand All @@ -26,27 +15,28 @@ defaults:
shell: bash

concurrency:
group: tests-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}
permissions:
contents: read

env:
# Force tox and pytest to use color
FORCE_COLOR: true


jobs:
build:
permissions:
contents: read # to fetch code (actions/checkout)

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3
- run: pip install --upgrade build twine
- name: Build sdist and wheel
run: python -m build
- run: twine check dist/*
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
- run: uv build
- run: uvx twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
Expand Down Expand Up @@ -82,70 +72,51 @@ jobs:
- name: Run tests
run: pytest --doctest-modules -v --pyargs nipype

stable:
test:
# Check each OS, all supported Python, minimum versions and latest releases
permissions:
contents: read # to fetch code (actions/checkout)

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
check: ["test"]
pip-flags: [""]
depends: ["REQUIREMENTS"]
deb-depends: [false]
nipype-extras: ["doc,tests,profiler"]
include:
- os: ubuntu-22.04
python-version: "3.9"
check: test
pip-flags: ""
depends: REQUIREMENTS
deb-depends: true
nipype-extras: doc,tests,profiler,duecredit,ssh
- os: ubuntu-20.04
python-version: "3.9"
check: test
pip-flags: ""
depends: REQUIREMENTS
deb-depends: true
nipype-extras: doc,tests,nipy,profiler,duecredit,ssh
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
dependencies: [none, full, pre]
# include:
# - os: ubuntu-latest
# python-version: "3.9"
# dependencies: min
exclude:
# Skip some intermediate versions for full tests
- python: "3.10"
dependencies: full
- python: "3.11"
dependencies: full
# Do not test pre-releases for versions out of SPEC0
- python-version: "3.9"
dependencies: pre
- python-version: "3.10"
dependencies: pre

env:
DEPENDS: ${{ matrix.depends }}
CHECK_TYPE: ${{ matrix.check }}
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
INSTALL_DEB_DEPENDENCIES: ${{ matrix.deb-depends }}
NIPYPE_EXTRAS: ${{ matrix.nipype-extras }}
INSTALL_TYPE: pip
CI_SKIP_TEST: 1
DEPENDS: ${{ matrix.dependencies }}

steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Create virtual environment
run: tools/ci/create_venv.sh
- name: Build archive
- name: Install tox
run: |
source tools/ci/build_archive.sh
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
- name: Install Debian dependencies
run: tools/ci/install_deb_dependencies.sh
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install dependencies
run: tools/ci/install_dependencies.sh
- name: Install Nipype
run: tools/ci/install.sh
- name: Run tests
run: tools/ci/check.sh
if: ${{ matrix.check != 'skiptests' }}
- uses: codecov/codecov-action@v5
uv tool install tox --with=tox-uv --with=tox-gh-actions
- name: Show tox config
run: tox c
- name: Run tox
run: tox -v --exit-and-dump-after 1200
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ always() }}
Expand Down

0 comments on commit 0aafdfc

Please sign in to comment.