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