Drops Python 3.8 support #189
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
on: | |
push: | |
branches: ["*"] | |
tags: ["release/*"] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "latest" | |
enable-cache: true | |
- name: Install Python | |
run: uv python install ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: uv sync -i https://pypi.org/simple # Ignore download URLs in uv.lock. | |
- name: Lint with ruff | |
run: uv run ruff check src/cosmic_ray | |
- name: Test with pytest | |
run: uv run pytest tests --run-slow | |
pypi-publish: | |
name: Upload release to PyPI | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/release') | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/cosmic-ray | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "latest" | |
enable-cache: true | |
- name: Install Python | |
run: uv python install 3.12 | |
- name: "Build distribution" | |
run: | | |
uv pip install build | |
uv run python -m build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |