Skip to content

[pre-commit.ci] pre-commit autoupdate #1311

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1311

Workflow file for this run

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-20.04, macos-latest, windows-2019, windows-2022]
name: Tests on ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: echo "FC=gfortran-11" >> $GITHUB_ENV
- name: Setup nox
uses: wntrblm/nox@2023.04.22
with:
python-versions: "3.7,3.8,3.9,3.10,3.11,3.12-dev"
# 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 -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: 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-latest, windows-latest]
pypy-version: ["3.9"]
include:
- runs-on: ubuntu-latest
pypy-version: "3.7"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup nox
uses: wntrblm/nox@2023.04.22
- 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
- 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) }}