Skip to content

Dev 0.1.2

Dev 0.1.2 #79

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.14"
enable-cache: false
- name: Install the project
run: |
uv cache clean
uv sync --locked --all-extras --dev
- name: Auto-fix with Ruff
uses: astral-sh/ruff-action@v3
with:
args: 'check --fix --exit-zero .'
- name: Format with Ruff
uses: astral-sh/ruff-action@v3
with:
args: 'format .'
- name: Prettify markdown code
uses: creyD/prettier_action@v4.6
with:
prettier_options: --write **/*.md
commit_message: "style: auto-format code (ruff & prettier)"
continue-on-error: true
- name: Commit Ruff changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: auto-format python code with ruff"
file_pattern: "*.py"
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10","3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.head_ref || github.ref_name }}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: Install the project
run: |
uv cache clean
uv sync --locked --all-extras --dev
- name: Test with pytest
run: |
uv run pytest