cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
90 lines
3.2 KiB
YAML
90 lines
3.2 KiB
YAML
name: redbear-ci
|
|
|
|
on:
|
|
push:
|
|
# Any version-like release branch (0.3.1, 0.3.2, 0.4.0, 0.5.0, 1.0.0, ...)
|
|
# keeps triggering CI — including the versioning-machinery checks below —
|
|
# without editing this file on every bump. Release branches start with a
|
|
# digit; master is listed explicitly.
|
|
branches: ["[0-9]*", master]
|
|
pull_request:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
toolchain: nightly-2026-05-24
|
|
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
toolchain: nightly-2026-05-24
|
|
components: rustfmt, clippy
|
|
|
|
- name: Check sync-versions compliance
|
|
run: ./local/scripts/sync-versions.sh --check
|
|
|
|
- name: Install b3sum (versioning machinery + validator)
|
|
run: sudo apt-get update && sudo apt-get install -y b3sum
|
|
|
|
- name: Versioning machinery unit tests
|
|
run: ./local/scripts/test-versioning-machinery.sh
|
|
|
|
- name: Vendored-source staleness invalidation test
|
|
run: ./local/scripts/test-vendored-source-staleness.sh
|
|
|
|
- name: Patch-sanity linter + test
|
|
run: |
|
|
./local/scripts/test-patch-sanity.sh
|
|
python3 ./local/scripts/verify-patch-sanity.py
|
|
|
|
- name: External recipe source-version consistency
|
|
# Fails if any tar recipe's vendored source/ (or tracked source.tar)
|
|
# diverges from its declared version — the Qt/KDE class of bug. Mirrors
|
|
# build-preflight.sh Phase 1.0C so divergence is caught on every push/PR,
|
|
# not only at build time.
|
|
run: ./local/scripts/verify-external-source-versions.sh
|
|
|
|
- name: cargo fmt check (redbear-* crates)
|
|
run: |
|
|
set -e
|
|
for f in $(find local/recipes -path "*redbear-*/source/Cargo.toml" -not -path "*/target/*"); do
|
|
echo "--- cargo fmt --check: $f ---"
|
|
cargo fmt --manifest-path "$f" -- --check
|
|
done
|
|
|
|
- name: cargo check (redbear-* crates)
|
|
run: |
|
|
set -e
|
|
for f in $(find local/recipes -path "*redbear-*/source/Cargo.toml" -not -path "*/target/*"); do
|
|
echo "--- cargo check: $f ---"
|
|
cargo check --manifest-path "$f" --target x86_64-unknown-redox --locked
|
|
done
|
|
continue-on-error: true
|
|
|
|
- name: cargo check host (library-only crates)
|
|
run: |
|
|
set -e
|
|
for f in $(find local/recipes -path "*redbear-hid-core/source/Cargo.toml" -not -path "*/target/*"); do
|
|
echo "--- cargo check host: $f ---"
|
|
cargo check --manifest-path "$f"
|
|
done
|
|
continue-on-error: true
|
|
|
|
- name: cargo test host (pure-logic crates)
|
|
run: |
|
|
set -e
|
|
for f in $(find local/recipes -path "*redbear-*/source/Cargo.toml" -not -path "*/target/*"); do
|
|
has_test=$(grep -c '\[\[test\]\]' "$f" 2>/dev/null || true)
|
|
if [ "$has_test" -gt 0 ]; then
|
|
echo "--- cargo test: $f ---"
|
|
cargo test --manifest-path "$f" || echo "NOTE: some tests may require Redox target; continuing"
|
|
fi
|
|
done
|
|
continue-on-error: true
|