Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
# ── Job 1: Lint ────────────────────────────────────────────────────
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install linter
run: pip install ruff

- name: Run lint
run: ruff check src/

# ── Job 2: Test ────────────────────────────────────────────────────
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}


- name: Install dependencies
run: pip install -r requirements.txt

- name: Run tests
run: pytest src/ --junitxml=test-results.xml

- uses: actions/upload-artifact@v4
if: always() # runs even if previous steps failed
with:
name: debug-logs
path: '*.log'
# ── Job 3: Build ───────────────────────────────────────────────────
build:
name: Build
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Build distribution
run: |
pip install build
cd src
python -m build --outdir ../dist

- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Loading