✨ Update CI and release workflows to use 'uv sync' for dependency ins… #2
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv sync --all-extras | |
- name: Run pre-commit | |
uses: pre-commit/action@v3.0.1 | |
test: | |
name: Test with ${{ matrix.python }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.11", "3.12", "3.13"] | |
os: ["ubuntu-latest"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv sync --all-extras --python ${{ matrix.python }} | |
- name: Test with pytest | |
run: uv run pytest | |
env: | |
COVERAGE_FILE: cov-${{ matrix.python }}${{ matrix.os }}.xml | |
- name: Save coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-reports | |
path: cov-${{ matrix.python }}${{ matrix.os }}.xml | |
coverage-report: | |
name: Coverage report | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Get coverage reports | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-reports | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install dependencies | |
run: uv sync --all-extras | |
- name: Combine reports | |
run: coverage combine cov-*.xml --data-file cov.xml | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./cov.xml |