diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5b58e46 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 + +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: ci + open-pull-requests-limit: 5 + groups: + github-actions: + patterns: + - "*" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2d345b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: true + + - name: Install dependencies + run: uv sync --group dev + + - name: Ruff check + run: uv run ruff check src tests + + - name: Ruff format check + run: uv run ruff format --check src tests + + - name: Pytest + run: uv run pytest \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 4097c5a..d515810 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,7 @@ uv run ruff format src tests # format uv run pre-commit run --all-files # lint + test in one shot ``` -No CI yet. Run `pre-commit` before committing. +CI runs on push to `main` and on PRs (`.github/workflows/ci.yml`): ruff check, ruff format check, pytest, all via `uv`. Third-party Actions are SHA-pinned; Dependabot bumps them weekly. Still run `pre-commit` before committing locally. ## Code style