Separate Evals step after Pytest; other checks unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
# Checks every pull request against main: locked environment, ruff lint and
|
|
# format, pyright (strict), pytest, the example eval set and the pre-commit
|
|
# hooks.
|
|
#
|
|
# Triggered only by `pull_request`: no `push` (branches are checked once, in
|
|
# their PR) and never `pull_request_target`, which would run with repository
|
|
# secrets on code from the PR.
|
|
#
|
|
# The container image is named explicitly so the Python version does not
|
|
# depend on the runner's defaults. uv is installed from a hashed requirements
|
|
# file (.gitea/ci/uv-requirements.txt) so that nothing is installed by name
|
|
# only; all project tools then come from uv.lock.
|
|
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
checks:
|
|
runs-on: linux-docker
|
|
container:
|
|
image: python:3.14-slim-trixie
|
|
env:
|
|
UV_PYTHON_DOWNLOADS: never
|
|
UV_LINK_MODE: copy
|
|
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
steps:
|
|
# nodejs must come before checkout: act_runner runs the JavaScript
|
|
# action actions/checkout with node inside the job container.
|
|
# pyright needs node as well.
|
|
- name: System dependencies
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends nodejs git ca-certificates
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install uv
|
|
run: pip install --root-user-action=ignore --require-hashes -r .gitea/ci/uv-requirements.txt
|
|
|
|
- name: Sync locked environment
|
|
run: uv sync --locked
|
|
|
|
- name: Ruff lint
|
|
run: uv run ruff check
|
|
|
|
- name: Ruff format
|
|
run: uv run ruff format --check
|
|
|
|
- name: Pyright
|
|
run: uv run pyright
|
|
|
|
- name: Pytest
|
|
run: uv run pytest
|
|
|
|
- name: Evals
|
|
run: uv run chemenu-eval evals/example
|
|
|
|
- name: Pre-commit hooks
|
|
run: |
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
uv run pre-commit run --all-files --show-diff-on-failure
|