Skip to content

Merge pull request #120 from bsweger/dependabot/uv/py-updates-748d260b0d #257

Merge pull request #120 from bsweger/dependabot/uv/py-updates-748d260b0d

Merge pull request #120 from bsweger/dependabot/uv/py-updates-748d260b0d #257

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
FORCE_COLOR: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
jobs:
generate-nox-sessions:
name: Get nox session lists to use for matrices in other jobs
runs-on: ubuntu-latest
outputs:
nox_tests: ${{ steps.set-matrix.outputs.nox_tests }}
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv 🌟
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0
with:
version: "0.9.16"
- name: Set nox session matrices 🧩
id: set-matrix
shell: bash
run: |
echo nox_tests=$(uvx nox --session tests --json -l | jq -c '[.[].session]') | tee --append $GITHUB_OUTPUT
lint:
name: Lint and type check
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv 🌟
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0
with:
version: "0.9.16"
- name: Lint 🧹
run: uvx nox --session lint
- name: Type Check 🧐
run: uvx nox --session typecheck
coverage:
name: Generate coverage reports & fail if below threshold
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv 🌟
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0
with:
version: "0.9.16"
- name: Generate coverage report πŸ“Š
# The coverage session runs the test suite using the latest stable
# python version and uses that output to generate the coverage report
# (as opposed to merging coverage reports from all python versions)
run: uvx nox --session coverage >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report if coverage check fails πŸ“€
uses: actions/upload-artifact@v7
with:
name: html-cov-report
path: htmlcov
if: ${{ failure() }}
tests:
name: Run tests
needs: generate-nox-sessions
runs-on: ubuntu-latest
strategy:
matrix:
nox_tests: ${{ fromJson(needs.generate-nox-sessions.outputs.nox_tests) }}
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv 🌟
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0
with:
version: "0.9.16"
- name: Run nox test session ${{ matrix.nox_tests }} πŸ§ͺ
run: uvx nox --session ${{ matrix.nox_tests }}
doc_build:
name: Test docs build
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv 🌟
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0
with:
version: "0.9.16"
- name: Run nox docs session πŸ“œ
run: uvx nox --session docs