Migrate actions to work with uv instead of rye, use commit for lint a… #64
Workflow file for this run
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: Code CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install uv" | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: "Install the project" | |
run: uv sync --frozen --all-extras --dev | |
- name: "Pre-commit" | |
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files | |
env: | |
SKIP: "update-version,ruff-format,hadolint" | |
shell: bash | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install uv" | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: "Install the project" | |
run: uv sync --frozen --all-extras --dev | |
- name: "Format" | |
run: uv run ruff format . --check --diff | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- 3.11 | |
- 3.12 | |
include: | |
- python-version: "3.13.0-rc.2" | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install uv" | |
uses: astral-sh/setup-uv@v2 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Install the project" | |
run: uv sync --frozen --all-extras --dev | |
- name: "Run tests with coverage" | |
env: | |
COVERAGE_FILE: .coverage.${{ runner.os }}-py${{ matrix.python }}-without-deps | |
CONTEXT: ${{ runner.os }}-py${{ matrix.python }}-without-deps | |
run: uv run coverage run -m pytest --durations=10 | |
- run: uv run coverage combine | |
- run: uv run coverage xml | |
- name: "Upload coverage to CodeCov" | |
uses: codecov/codecov-action@v4 | |
if: ${{ !env.ACT }} | |
with: | |
file: coverage.xml | |
env_vars: PYTHON,OS |