Skip to content

Merge pull request #10 from SamBroomy/version-bump #25

Merge pull request #10 from SamBroomy/version-bump

Merge pull request #10 from SamBroomy/version-bump #25

Workflow file for this run

---
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
pull-requests: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv with Caching
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install Dependencies
run: |
uv sync --dev
- name: Run Ruff
run: uv run ruff check --output-format=github .
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv with Caching
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
uv sync --dev
- name: Run Tests with Coverage
run: |
uv run pytest
- name: Minimize uv Cache
run: uv cache prune --ci
publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
needs: test
permissions:
id-token: write
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install git
run: sudo apt-get install git
- name: Install uv with Caching
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Bump Version, Build, Publish
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub CI"
uvx --from rust-just just publish-package
- name: Minimize uv Cache
run: uv cache prune --ci