-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 4.08 KB
/
Copy pathci.yml
File metadata and controls
93 lines (81 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches: [master]
pull_request:
# Read-only workflow: checkout + build + test only. Explicit least-privilege
# declaration so a future step cannot silently gain write access.
permissions:
contents: read
# Optional but recommended: cancel superseded runs on the same ref so a
# fresh push or PR update does not queue behind an outdated run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# The agent consumes pd-vm / pd-host-function from the canonical HTTPS Git
# remote, pinned to a full revision in Cargo.toml; Cargo.lock records that
# exact git source. `--locked` builds fetch exactly that revision from
# github.com into the cargo git cache — no sibling checkout of the core
# repository is required or used (tests/dependency_pin_tests.rs enforces
# the canonical source and full revision; bump only together with a
# Cargo.lock refresh).
# Integration tests place temporary SQLite state and fixture scripts
# here. Every suite honors this variable; without it they fall back to
# /mnt/TEMP/rustscript/... which is the local-development default and
# not writable on CI runners.
RUSTSCRIPT_AGENT_TEST_TMP: ${{ runner.temp }}/rustscript-agent-tests
jobs:
quality:
name: fmt, clippy, tests
runs-on: ubuntu-latest
steps:
- name: Checkout rustscript-agent
# Full-SHA pin, matching the rustscript-lang/rustscript CI policy
# (actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5).
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install Rust toolchain
# Full-SHA pin, matching the rustscript-lang/rustscript CI policy
# (dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30).
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
components: rustfmt, clippy
- name: Cache cargo registry, git db, and build target
# Full-SHA pin of the v2 tag (verified: v2 →
# 6323deb102c322ba6fcbdcafc7e3dddab59af2b6). Caches the fetched
# pinned core revision (cargo git db) plus registry and build
# target, so `cargo fetch`/test runs stay correct and fast.
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (warnings denied)
run: cargo clippy --locked --all-features --all-targets -- -D warnings
# The default suite runs all non-ignored tests. The only remaining
# #[ignore]d suites are the openai_responses / anthropic_messages
# placeholder references (not_implemented adapter stubs — pure agent
# work, unrelated to the core contract gate); the core repro driver
# and all OpenAI Chat suites run by default — see
# plans/2026-08-13_a3-provider-core-blocker.md.
- name: Test (workspace, all features, all targets)
run: cargo test --locked --all-features --all-targets
# Whitespace diagnostic: `git diff --check` reports trailing-whitespace
# errors in any tracked-file change a step leaves. On a fresh checkout
# with no drift it is a no-op, which is the point — the authoritative
# gate below is what actually fails on drift.
- name: No whitespace errors in tracked changes
run: git diff --check
# Fail on real drift instead: every step above must leave the working
# tree exactly as checked out. `git diff --exit-code` only sees tracked
# modifications, so this gate uses `git status --porcelain`, which
# reports both tracked changes and untracked/generated files — it
# catches tests writing state into the checkout instead of
# $RUSTSCRIPT_AGENT_TEST_TMP, and any file a step leaves behind.
- name: Working tree must stay clean (tracked and untracked)
run: |
status="$(git status --porcelain)"
if [[ -n "$status" ]]; then
echo "::error::working tree is not clean after CI steps:"
printf '%s\n' "$status"
exit 1
fi