tests #147
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
schedule: | |
# Run every Sunday | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
jobs: | |
code-quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-suffix: "dev" | |
cache-dependency-glob: | | |
uv.lock | |
- name: Run linting | |
run: | | |
just lint | |
- name: Run typechecking | |
run: | | |
just typecheck | |
tests: | |
name: "Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})" | |
needs: code-quality | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-suffix: "tests-${{ matrix.python-version }}" | |
cache-dependency-glob: | | |
pyproject.toml | |
- name: Run tests | |
run: | | |
just python=${{ matrix.python-version }} test | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
fail_ci_if_error: ${{ (github.event_name == 'push' && true) || (github.event_name == 'pull_request' && true) || false }} | |
notify: | |
name: Notify failed build | |
needs: [code-quality, tests] | |
if: failure() && github.event.pull_request == null | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jayqi/failed-build-issue-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |