generated from john/python-template
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8580aa7a1a |
@@ -0,0 +1,45 @@
|
|||||||
|
name: Quality Gate
|
||||||
|
|
||||||
|
# V4.7 Phase 6 / review log [40]. Before this, ruff, ty and pytest were enforced
|
||||||
|
# only by .pre-commit-config.yaml, and only for developers who had actually run
|
||||||
|
# `pre-commit install`.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out the commit under test
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
run: |
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
|
- name: Install dependencies from the lockfile
|
||||||
|
# --locked fails if uv.lock has drifted from pyproject.toml, so a stale
|
||||||
|
# lockfile is caught here rather than producing an untested dependency set.
|
||||||
|
run: uv sync --locked
|
||||||
|
|
||||||
|
- name: Write placeholder configuration
|
||||||
|
# Settings requires openrouter_api_key and 115 tests cannot construct
|
||||||
|
# Settings without it. This is written to a .env file rather than exported
|
||||||
|
# as an environment variable on purpose: the external tests guard on
|
||||||
|
# os.getenv("OPENROUTER_API_KEY"), which reads the process environment and
|
||||||
|
# not the file, so writing the file reproduces the local result exactly -
|
||||||
|
# the 4 external tests skip instead of running against a fake key and
|
||||||
|
# failing. Exporting it instead produces 3 failures.
|
||||||
|
run: echo "OPENROUTER_API_KEY=ci-placeholder-not-a-real-key" > .env
|
||||||
|
|
||||||
|
- name: Lint and type check
|
||||||
|
# Runs the hooks defined in .pre-commit-config.yaml instead of repeating
|
||||||
|
# "ruff check" and "ty check" here. The commands then have one definition,
|
||||||
|
# so the local and CI gates cannot drift apart.
|
||||||
|
run: uv run pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
|
- name: Tests
|
||||||
|
run: uv run pytest
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
"""Scratch file for the Phase 6 CI negative test. Deleted with this branch."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def broken() -> int:
|
||||||
|
return undefined_name_that_does_not_exist
|
||||||
Reference in New Issue
Block a user