44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Python Quality & Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main, 'releases/**']
|
|
paths: ['**.py']
|
|
pull_request:
|
|
branches: [main, 'releases/**']
|
|
paths: ['**.py']
|
|
|
|
# Automatically cancel older runs of the same PR/branch if a new commit is pushed
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
quality:
|
|
name: Lint, Typecheck, and Test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install uv (Fastest Python Tooling)
|
|
uses: astral-sh/setup-uv@v3
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.14
|
|
|
|
- name: Install Dependencies
|
|
run: uv pip install -r requirements/local.txt
|
|
|
|
- name: Lint and Format (Ruff)
|
|
# Replaces Black and Flake8 in one go
|
|
run: uv run ruff check fooder && uv run ruff format --check fooder
|
|
|
|
- name: Type Check (Mypy)
|
|
run: uv run mypy fooder
|
|
|
|
- name: Run Tests
|
|
run: chmod +x ./test.sh && ./test.sh
|