Skip to content

Commit 4f17877

Browse files
committed
enh: revise GHA
1 parent 762d99a commit 4f17877

File tree

3 files changed

+117
-101
lines changed

3 files changed

+117
-101
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Stable tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- maint/*
8+
- next
9+
pull_request:
10+
branches:
11+
- master
12+
- maint/*
13+
- next
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
# Force tox and pytest to use color
20+
env:
21+
FORCE_COLOR: true
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
test:
32+
# Check each OS, all supported Python, minimum versions and latest releases
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: ['ubuntu-latest']
37+
python-version: ['3.10', '3.11', '3.12', '3.13']
38+
dependencies: ['latest', 'pre']
39+
include:
40+
- os: ubuntu-latest
41+
python-version: '3.10'
42+
dependencies: 'min'
43+
44+
env:
45+
DEPENDS: ${{ matrix.dependencies }}
46+
47+
steps:
48+
- uses: actions/checkout@v5
49+
with:
50+
submodules: recursive
51+
fetch-depth: 0
52+
- uses: actions/cache@v4
53+
with:
54+
path: ~/.cache/templateflow
55+
key: templateflow-v1
56+
- name: Install dependencies
57+
run: |
58+
sudo apt update
59+
sudo apt install -y --no-install-recommends graphviz
60+
- name: Install the latest version of uv
61+
uses: astral-sh/setup-uv@v6
62+
- name: Set up Python ${{ matrix.python-version }}
63+
uses: actions/setup-python@v6
64+
with:
65+
python-version: ${{ matrix.python-version }}
66+
- name: Display Python version
67+
run: python -c "import sys; print(sys.version)"
68+
- name: Install tox
69+
run: |
70+
uv tool install --with=tox-uv --with=tox-gh-actions tox
71+
- name: Show tox config
72+
run: tox c
73+
- name: Run tox
74+
run: tox -v --exit-and-dump-after 1200
75+
- uses: codecov/codecov-action@v5
76+
with:
77+
token: ${{ secrets.CODECOV_TOKEN }}
78+
if: ${{ always() }}
79+
80+
checks:
81+
runs-on: "ubuntu-latest"
82+
continue-on-error: true
83+
strategy:
84+
matrix:
85+
check: ["style", "spellcheck"]
86+
87+
steps:
88+
- uses: actions/checkout@v5
89+
with:
90+
persist-credentials: false
91+
- name: Install the latest version of uv
92+
uses: astral-sh/setup-uv@v6
93+
- name: Install tox
94+
run: uv tool install tox --with=tox-uv
95+
- name: Show tox config
96+
run: tox c -e ${{ matrix.check }}
97+
- name: Run check
98+
run: tox -e ${{ matrix.check }}

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
exclude: ".*/data/.*|.maint/.*_author.*.py|.vscode/.*.json"
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
exclude: '.*\.svg'
8+
- id: end-of-file-fixer
9+
exclude: '.*\.svg'
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-toml
13+
- id: check-added-large-files
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.13.3
16+
hooks:
17+
- id: ruff-check
18+
args: [ --fix ]
19+
- id: ruff-format

0 commit comments

Comments
 (0)