|
| 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 }} |
0 commit comments