The afw line adds the cargo vendor tree (vendor/) and the flare-ui source (third-party/). Their upstream files carry trailing whitespace and SSE golden fixtures end with a blank line by format; editing them would break cargo's vendor checksums and the fixtures. Exclude both trees from git diff --check in source-pr and fast-pr, as the toolkit's gate does. No first-party file fails the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
name: source-pr
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, next]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: alkane-os-source-pr-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
source:
|
|
runs-on: alkane-fast
|
|
container:
|
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
CARGO_BUILD_JOBS: 2
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check runner image pins
|
|
run: python3 ci/check-runner-image.py
|
|
- name: Detect README-only change
|
|
id: surface
|
|
run: |
|
|
surface=full
|
|
if [ "$GITHUB_EVENT_NAME" = pull_request ] &&
|
|
{ [ "$GITHUB_BASE_REF" = main ] || [ "$GITHUB_BASE_REF" = next ]; } &&
|
|
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF" 2>/dev/null)" &&
|
|
changed="$(git diff --no-renames --name-only "$base" HEAD)" &&
|
|
[ "$changed" = README.md ]; then
|
|
surface=documentation
|
|
fi
|
|
echo "surface=$surface" >> "$GITHUB_OUTPUT"
|
|
- name: Check README-only change
|
|
if: steps.surface.outputs.surface == 'documentation'
|
|
run: |
|
|
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF")"
|
|
git diff --check "$base" HEAD -- . ':(exclude)vendor' ':(exclude)third-party'
|
|
if git grep -nIE '^[[:space:]]*-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----[[:space:]]*$' --; then
|
|
echo "private key material found in tracked source" >&2
|
|
exit 1
|
|
else
|
|
status=$?
|
|
[ "$status" -eq 1 ]
|
|
fi
|
|
- name: Check source
|
|
if: steps.surface.outputs.surface != 'documentation'
|
|
run: |
|
|
rustup component add rustfmt
|
|
cargo fmt --check
|
|
cargo test --locked
|
|
- name: Clean generated source check
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|