Skip to content
Merged
Show file tree
Hide file tree
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
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI / Build & Test

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'master' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
ci:
name: Check, Lint & Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --all-extras

- name: Type check (pyrefly)
run: uv run pyrefly check

- name: Lint (ruff)
run: uv run ruff check .

- name: Test (pytest)
run: uv run pytest
44 changes: 44 additions & 0 deletions .github/workflows/conventional-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Conventional Commit Check

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
validate_pr_title:
name: Validate PR Title
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate PR title
id: check_title
run: |
#!/bin/bash
set -euo pipefail

# Allowed prefixes
PREFIXES=("feat" "fix" "docs" "style" "refactor" "test" "chore" "ci" "perf")

# Get PR title
PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
echo "PR title: $PR_TITLE"

# Regex for conventional commit: prefix[optional scope][optional !]: description
PREFIX_PATTERN=$(IFS="|"; echo "${PREFIXES[*]}")
REGEX="^(${PREFIX_PATTERN})(\\([a-zA-Z0-9_-]+\\))?(!)?: .+"

if [[ "$PR_TITLE" =~ $REGEX ]]; then
echo "PR title follows Conventional Commits."
else
echo "PR title does NOT follow Conventional Commits."
echo "Expected format: <type>[optional scope][!]: description"
echo "Allowed types: ${PREFIXES[*]}"
echo "Examples:"
echo " feat: add login endpoint"
echo " fix(auth)!: fix critical bug"
exit 1
fi

Loading