Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #229 from jhlegarreta/TransitionCIToGHA
Browse files Browse the repository at this point in the history
MAINT: Transition CI to GHA
  • Loading branch information
oesteban authored Sep 27, 2024
2 parents fcd9e94 + d34b63f commit a7880a3
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 113 deletions.
109 changes: 0 additions & 109 deletions .circleci/config.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Tests

on:
push:
branches:
- main
- maint/*
pull_request:
branches:
- main
- maint/*
# Allow job to be triggered manually from GitHub interface
workflow_dispatch:

defaults:
run:
shell: bash

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

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

permissions:
contents: read

jobs:
stable:
# Check each OS, all supported Python, minimum versions and latest releases
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.10', '3.11', '3.12']
dependencies: ['full', 'pre']
include:
- os: ubuntu-latest
python-version: '3.10'
dependencies: 'min'

env:
DEPENDS: ${{ matrix.dependencies }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox 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
if: ${{ always() }}
with:
files: cov.xml
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
:target: https://pypi.python.org/pypi/eddymotion/
:alt: Latest Version

.. image:: https://circleci.com/gh/nipreps/eddymotion/tree/main.svg?style=shield
:target: https://circleci.com/gh/nipreps/eddymotion/tree/main
.. image:: https://github.com/nipreps/eddymotion/actions/workflows/test.yml/badge.svg
:target: https://github.com/nipreps/eddymotion/actions/workflows/test.yml
:alt: Testing

.. image:: https://github.com/nipreps/eddymotion/actions/workflows/pages/pages-build-deployment/badge.svg
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ filterwarnings = ["ignore::DeprecationWarning"]

[tool.coverage.run]
branch = true
concurrency = 'multiprocessing'
concurrency = ['multiprocessing']
omit = [
'*/tests/*',
'*/__init__.py',
Expand Down
2 changes: 1 addition & 1 deletion test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def test_main(tmp_path, datadir):
)
# assert Path(output_dir).joinpath("dwi.h5").exists() # Empty

# Also, call python -m eddymotion or eddymotion from CircleCI ??
# Also, call python -m eddymotion or eddymotion from GHA ??
85 changes: 85 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[tox]
requires =
tox>=4
envlist =
py3{10,11,12}-{full,pre}
py310-min
skip_missing_interpreters = true

# Configuration that allows us to split tests across GitHub runners effectively
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DEPENDS =
min: min
full: full
pre: pre

[testenv]
description = Pytest with coverage
labels = test
pip_pre =
pre: true
pass_env =
# getpass.getuser() sources for Windows:
LOGNAME
USER
LNAME
USERNAME
# Pass user color preferences through
PY_COLORS
FORCE_COLOR
NO_COLOR
CLICOLOR
CLICOLOR_FORCE
extras = test
deps =
min: nipype ==1.8.5
min: pybids ==0.15.6
commands =
pytest --doctest-modules --cov eddymotion --cov-report xml \
--junitxml=test-results.xml -v src/eddymotion {posargs}

[testenv:docs]
description = Build documentation site
labels = docs
allowlist_externals = make
extras = doc
commands =
make -C doc html

[testenv:spellcheck]
description = Check spelling
labels = check
deps =
codespell[toml]
skip_install = true
commands =
codespell . {posargs}

[testenv:build{,-strict}]
labels =
check
pre-release
deps =
build
twine
skip_install = true
set_env =
build-strict: PYTHONWARNINGS=error
commands =
python -m build
python -m twine check dist/*

[testenv:publish]
depends = build
labels = release
deps =
twine
skip_install = true
commands =
python -m twine upload dist/*

0 comments on commit a7880a3

Please sign in to comment.