Update uv #3
This file contains 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: Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * 0' # once a week | |
env: | |
UV_VERSION: 0.6.0 | |
jobs: | |
code-quality: | |
name: Code quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Install dependencies | |
run: uv sync | |
- name: Check formatting | |
run: uv run ruff format --check | |
- name: Check linting | |
run: uv run ruff check --output-format=github | |
- name: Check types | |
run: uv run mypy . | |
tests: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
- 'windows-latest' | |
python: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
- '3.13' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Install dependencies | |
run: uv sync | |
- name: Run tests | |
run: uv run tox | |
env: | |
TOX_GH_MAJOR_MINOR: ${{ matrix.python }} | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.os }}-${{ matrix.python }} | |
path: .tox/*/.coverage | |
include-hidden-files: true | |
retention-days: 1 | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: .python-version | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
- name: Install dependencies | |
run: uv sync | |
- name: Download coverage data | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-* | |
- name: Combine coverage data | |
run: uv run coverage combine coverage-*/*/.coverage | |
- name: Report coverage | |
run: uv run coverage report --fail-under 100 |