Update astral-sh/setup-uv action to v5 #176
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: CI/CD Pipeline | |
on: | |
push: | |
pull_request: | |
release: | |
types: | |
- published | |
permissions: | |
contents: read | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- 3.12 | |
- 3.13 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up uv | |
uses: astral-sh/[email protected] | |
with: | |
version: 0.5.6 | |
- name: Install project | |
run: uv sync --group=testing | |
- name: Run tests | |
run: uv run --frozen pytest | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
publish-to-pypi: | |
if: github.event_name == 'release' && github.event.action == 'published' | |
needs: run-tests | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: 0.5.6 | |
enable-cache: true | |
- name: Build package | |
run: uv build | |
- name: Publish package | |
run: uv publish |