ci(gates): add full local verification script
This commit is contained in:
parent
7a71110bb4
commit
c25c35f82c
@ -10,28 +10,4 @@ set -u
|
||||
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo .)
|
||||
cd "$ROOT" || exit 1
|
||||
|
||||
FAIL=0
|
||||
|
||||
# Always: repo-wide style and namespacing gates.
|
||||
bash scripts/check-style.sh || FAIL=1
|
||||
bash scripts/check-namespacing.sh || FAIL=1
|
||||
bash scripts/check-changelog-touched.sh || FAIL=1
|
||||
|
||||
if command -v swiftformat >/dev/null 2>&1; then
|
||||
swiftformat . --config .swiftformat --lint || FAIL=1
|
||||
else
|
||||
echo "pre-push: swiftformat not installed, skipping format check" >&2
|
||||
fi
|
||||
if command -v swiftlint >/dev/null 2>&1; then
|
||||
swiftlint --config .swiftlint.yml --strict || FAIL=1
|
||||
else
|
||||
echo "pre-push: swiftlint not installed, skipping lint check" >&2
|
||||
fi
|
||||
swift build || FAIL=1
|
||||
swift test || FAIL=1
|
||||
bash scripts/check-wasm.sh || FAIL=1
|
||||
|
||||
if [ "$FAIL" -ne 0 ]; then
|
||||
echo "pre-push: one or more gates failed; push aborted." >&2
|
||||
exit 1
|
||||
fi
|
||||
bash scripts/check-all.sh
|
||||
|
||||
@ -34,6 +34,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
suites.
|
||||
- Add macOS, Linux, and WASM verification gates and CI jobs, plus a local Linux
|
||||
check that can run through Claw Mini's Lima VM.
|
||||
- Add a single full local verification script and wire pre-push through the
|
||||
macOS, Claw Mini Linux, and WASM gate sequence.
|
||||
- Harden the changelog gate so local verification also sees unstaged source
|
||||
edits, not only committed or staged changes.
|
||||
- Add Yams and CYaml attribution without copying their implementation into
|
||||
`Sources/`.
|
||||
|
||||
|
||||
14
README.md
14
README.md
@ -45,7 +45,7 @@ flowchart TB
|
||||
classDef epic fill:#f2e5ff,stroke:#af52de,color:#111827
|
||||
classDef todo fill:#f2f4f7,stroke:#8e8e93,color:#111827
|
||||
SuperEpic8["#8 Parser Replacement Roadmap"]:::epic
|
||||
Epic1["#1 Pure Swift Parse Core"]:::epic
|
||||
Epic1["#1 Pure Swift Parse Core"]:::done
|
||||
SuperEpic8 --> Epic1
|
||||
```
|
||||
|
||||
@ -62,7 +62,7 @@ flowchart TB
|
||||
Issue4["#4 Token Stream to Events"]:::done
|
||||
Issue5["#5 Events to PureYAML Values"]:::done
|
||||
Issue6["#6 Scalars Tags and Aliases"]:::done
|
||||
Issue7["#7 macOS Linux and WASM Hardening"]:::todo
|
||||
Issue7["#7 macOS Linux and WASM Hardening"]:::done
|
||||
Issue2 --> Issue3
|
||||
Issue3 --> Issue4
|
||||
Issue4 --> Issue5
|
||||
@ -114,6 +114,12 @@ try PureYAML.validate(document)
|
||||
|
||||
PureYAML must stay dependency-free and portable. Before merging changes:
|
||||
|
||||
```sh
|
||||
bash scripts/check-all.sh
|
||||
```
|
||||
|
||||
That command expands to:
|
||||
|
||||
```sh
|
||||
bash scripts/check-style.sh
|
||||
bash scripts/check-namespacing.sh
|
||||
@ -127,6 +133,10 @@ bash scripts/check-linux.sh
|
||||
bash scripts/check-wasm.sh
|
||||
```
|
||||
|
||||
The pre-push hook runs `scripts/check-all.sh` so local pushes exercise macOS,
|
||||
Claw Mini Linux, and WASM before hosted CI repeats the macOS, Linux, and WASM
|
||||
matrix.
|
||||
|
||||
`scripts/check-wasm.sh` expects a Swift toolchain with a matching Swift Wasm SDK.
|
||||
For Swift 6.3.2, install the SDK with:
|
||||
|
||||
|
||||
25
scripts/check-all.sh
Executable file
25
scripts/check-all.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Full local verification gate for PureYAML.
|
||||
#
|
||||
# Runs the checks required before completion, including the Claw Mini Linux
|
||||
# check when executed from macOS and the WASM SDK build check.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
run_gate() {
|
||||
name="$1"
|
||||
shift
|
||||
printf '\n==> %s\n' "$name"
|
||||
"$@"
|
||||
}
|
||||
|
||||
run_gate "style" bash scripts/check-style.sh
|
||||
run_gate "namespacing" bash scripts/check-namespacing.sh
|
||||
run_gate "changelog" bash scripts/check-changelog-touched.sh
|
||||
run_gate "roadmap" bash scripts/check-roadmap.sh
|
||||
run_gate "swiftformat" swiftformat . --config .swiftformat --lint
|
||||
run_gate "swiftlint" swiftlint --config .swiftlint.yml --strict
|
||||
run_gate "swift build" swift build
|
||||
run_gate "swift test" swift test
|
||||
run_gate "linux" bash scripts/check-linux.sh
|
||||
run_gate "wasm" bash scripts/check-wasm.sh
|
||||
@ -18,10 +18,13 @@ if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then
|
||||
fi
|
||||
fi
|
||||
|
||||
changed=$(git diff --name-only "$BASE_REF"...HEAD --)
|
||||
if [ -z "$changed" ]; then
|
||||
changed=$(git diff --cached --name-only --)
|
||||
fi
|
||||
changed=$(
|
||||
{
|
||||
git diff --name-only "$BASE_REF"...HEAD --
|
||||
git diff --cached --name-only --
|
||||
git diff --name-only --
|
||||
} | awk 'NF && !seen[$0]++'
|
||||
)
|
||||
|
||||
source_touched=0
|
||||
while IFS= read -r path; do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user