update setup-python version #10
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: Python package | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
lock_file: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- run: uv lock --locked | |
linting: | |
runs-on: ubuntu-latest | |
needs: [lock_file] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- run: uvx ruff check . | |
formatting: | |
runs-on: ubuntu-latest | |
needs: [lock_file] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- run: uvx ruff format --check . | |
type_consistency: | |
runs-on: ubuntu-latest | |
needs: [lock_file] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- run: uv run pyright . | |
tests: | |
runs-on: ubuntu-latest | |
needs: [lock_file] | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: ./.github/actions/setup | |
- run: uv run pytest -v --durations=0 --cov --cov-report=xml | |
# TODO | |
# - name: Upload Coverage to Codecov | |
# uses: codecov/codecov-action@v4 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
build_and_deploy: | |
runs-on: [ubuntu-latest] | |
needs: [linting, formatting, type_consistency, tests] | |
# Run only on manual trigger | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- run: uv run python -m build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |