1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: "3"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
tests:
runs-on: ${{ matrix.runs-on }}
needs: [lint]
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-22.04, macos-13, windows-2019, windows-2022]
name: Tests on ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: yezz123/setup-uv@v4
- name: Set environment for available GHA MSVCs
if: matrix.runs-on == 'windows-2019'
shell: bash
run: |
echo "SKBUILD_TEST_FIND_VS2017_INSTALLATION_EXPECTED=0" >> $GITHUB_ENV
echo "SKBUILD_TEST_FIND_VS2019_INSTALLATION_EXPECTED=1" >> $GITHUB_ENV
echo "SKBUILD_TEST_FIND_VS2022_INSTALLATION_EXPECTED=0" >> $GITHUB_ENV
- name: Set environment for available GHA MSVCs
if: matrix.runs-on == 'windows-2022'
shell: bash
run: |
echo "SKBUILD_TEST_FIND_VS2017_INSTALLATION_EXPECTED=0" >> $GITHUB_ENV
echo "SKBUILD_TEST_FIND_VS2019_INSTALLATION_EXPECTED=0" >> $GITHUB_ENV
echo "SKBUILD_TEST_FIND_VS2022_INSTALLATION_EXPECTED=1" >> $GITHUB_ENV
- name: Set environment for Fortran compiler on MacOS
if: runner.os == 'macOS'
run: |
brew reinstall gfortran
echo "FC=gfortran" >> $GITHUB_ENV
- name: Setup nox
uses: wntrblm/nox@2024.04.15
with:
python-versions: "3.7,3.8,3.9,3.10,3.11,3.12,3.13"
# We check all Python's on Linux, because it's fast.
# We check minimum Python and maximum Python on all OS's.
- name: Test on 🐍 3.7
run: >
nox --default-venv-backend=${{ startsWith(matrix.runs-on, 'windows') && 'virtualenv' || 'uv'}}
-s tests-3.7 -- --cov --cov-report=xml --cov-report=term --durations=20
- name: Test on 🐍 3.8
if: runner.os == 'Linux'
run: nox -s tests-3.8 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
- name: Test on 🐍 3.9
if: runner.os == 'Linux'
run: nox -s tests-3.9 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
- name: Test on 🐍 3.10
if: runner.os == 'Linux'
run: nox -s tests-3.10 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
- name: Test on 🐍 3.11
run: nox -s tests-3.11 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
- name: Test on 🐍 3.12
run: nox -s tests-3.12 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
if: runner.os == 'Linux'
- name: Test on 🐍 3.13
run: nox -s tests-3.13 -- --cov --cov-report=xml --cov-report=term --cov-append --durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
name: ${{ matrix.runs-on }}-any
verbose: true
cygwin:
name: Tests on 🐍 3.9 • cygwin
runs-on: windows-latest
timeout-minutes: 120
needs: [lint]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
packages: cmake ninja git make gcc-g++ gcc-fortran python39 python39-devel python39-pip
- name: Install nox
run: python3.9 -m pip install nox
- name: Run tests
env:
TMP: /tmp
TEMP: /tmp
run: python3.9 -m nox -s tests-3.9 -- -m "not deprecated" --durations=20
tests-pypy:
name: Tests on 🐍 PyPy ${{ matrix.pypy-version }} • ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 40
needs: [lint]
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-13, windows-latest]
pypy-version: ["3.9"]
include:
- runs-on: ubuntu-latest
pypy-version: "3.7"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: yezz123/setup-uv@v4
- name: Setup nox
uses: wntrblm/nox@2024.04.15
- uses: actions/setup-python@v5
with:
python-version: pypy-${{ matrix.pypy-version }}
- name: Test on 🐍 PyPy ${{ matrix.pypy-version }}
run: >
nox -s tests-pypy${{ matrix.pypy-version }} --
--cov --cov-report=xml --cov-report=term --durations=20
${{ matrix.runs-on == 'windows-latest' && '-k "not pep518"' || '' }}
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
name: ${{ runner.os }}-${{ matrix.pypy-version }}
verbose: true
dist:
name: Distribution
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build SDist and wheel
run: pipx run build
- uses: actions/upload-artifact@v4
with:
path: dist/*
- name: Check metadata
run: pipx run twine check dist/*
pass:
if: always()
timeout-minutes: 1
needs: [tests, tests-pypy, dist]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
|