002f8f0ba1
Add AUTHOR_MAP plus a lightweight co-author trailer checker so harvested commits use numeric GitHub noreply identities, reject bot/tool trailers, and require machine-readable credit when a commit says it was harvested from a PR.
Also normalize the local unpushed v0.9 harvest range so existing contributor authors/trailers for HUQIANTAO, Implementist, jrcjrcc, xyuai, cyq1017, idling11, and shenjackyuanjie use GitHub-mappable identities before the branch is published.
Validation: python3 scripts/check-coauthor-trailers.py --author-map .github/AUTHOR_MAP --range origin/main..HEAD --check-authors; python3 -m py_compile scripts/check-coauthor-trailers.py; ruby -e 'require "yaml"; YAML.load_file(".github/workflows/ci.yml")'; git diff --check; negative in-process validation for raw email, missing harvested credit, and bot author cases.
179 lines
5.7 KiB
YAML
179 lines
5.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
pull_request:
|
|
branches: [master, main]
|
|
schedule:
|
|
- cron: '31 6 * * 1'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
versions:
|
|
name: Version drift
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- name: Check version drift
|
|
run: ./scripts/release/check-versions.sh
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
- name: Install Linux system dependencies
|
|
run: |
|
|
for i in 1 2 3 4 5; do
|
|
sudo apt-get update && break
|
|
echo "apt-get update failed (attempt $i); retrying in 15s"
|
|
sleep 15
|
|
done
|
|
sudo apt-get install -y libdbus-1-dev pkg-config
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
- name: Run clippy
|
|
run: cargo clippy --workspace --all-features --locked -- -D warnings
|
|
- name: Check provider registry drift
|
|
run: python3 scripts/check-provider-registry.py
|
|
- name: Check harvested contributor credit
|
|
if: github.event_name != 'schedule'
|
|
shell: bash
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
git fetch --no-tags origin "${{ github.base_ref }}"
|
|
RANGE="origin/${{ github.base_ref }}..HEAD"
|
|
elif [[ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
|
RANGE="${{ github.event.before }}..${{ github.sha }}"
|
|
else
|
|
RANGE="HEAD~1..HEAD"
|
|
fi
|
|
python3 scripts/check-coauthor-trailers.py \
|
|
--author-map .github/AUTHOR_MAP \
|
|
--range "$RANGE" \
|
|
--check-authors
|
|
- name: Linux clippy location
|
|
run: echo "Linux clippy/test gates run on CNB for mirrored fix/*, rebrand/*, work/v*, and main branches."
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
# Linux workspace tests moved to CNB; GitHub keeps the platform
|
|
# coverage CNB cannot provide.
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
if: runner.os != 'Linux'
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
if: runner.os != 'Linux'
|
|
- uses: Swatinem/rust-cache@v2
|
|
if: runner.os != 'Linux'
|
|
with:
|
|
cache-bin: false
|
|
- name: Run tests
|
|
if: runner.os != 'Linux'
|
|
run: cargo test --workspace --all-features --locked
|
|
- name: Lockfile drift guard
|
|
if: runner.os != 'Linux'
|
|
run: git diff --exit-code -- Cargo.lock
|
|
- name: Run Offline Eval Harness
|
|
if: runner.os != 'Linux'
|
|
run: cargo run -p codewhale-tui --all-features -- eval
|
|
- name: Linux test location
|
|
if: runner.os == 'Linux'
|
|
run: echo "Linux workspace tests run on CNB for mirrored first-party branches."
|
|
|
|
npm-wrapper-smoke:
|
|
name: npm wrapper smoke
|
|
if: github.event_name != 'schedule'
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["ubuntu-latest","macos-latest","windows-latest"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
if: runner.os != 'Linux'
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
if: runner.os != 'Linux'
|
|
- uses: actions/setup-node@v4
|
|
if: runner.os != 'Linux'
|
|
with:
|
|
node-version: 20
|
|
- uses: Swatinem/rust-cache@v2
|
|
if: runner.os != 'Linux'
|
|
with:
|
|
cache-bin: false
|
|
- name: Build wrapper binaries
|
|
if: runner.os != 'Linux'
|
|
run: cargo build --release --locked -p codewhale-cli -p codewhale-tui
|
|
- name: Smoke wrapper install and delegated entrypoints
|
|
if: runner.os != 'Linux'
|
|
run: node scripts/release/npm-wrapper-smoke.js
|
|
- name: Linux smoke location
|
|
if: runner.os == 'Linux'
|
|
run: echo "Linux npm wrapper smoke runs on CNB for mirrored first-party branches."
|
|
|
|
mobile-smoke:
|
|
name: Mobile runtime smoke
|
|
if: github.event_name != 'schedule'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Install Linux system dependencies
|
|
run: |
|
|
for i in 1 2 3 4 5; do
|
|
sudo apt-get update && break
|
|
echo "apt-get update failed (attempt $i); retrying in 15s"
|
|
sleep 15
|
|
done
|
|
sudo apt-get install -y libdbus-1-dev pkg-config
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-bin: false
|
|
- name: Run mobile smoke tests
|
|
run: ./scripts/mobile-smoke.sh
|
|
|
|
# Check documentation builds without warnings
|
|
docs:
|
|
name: Documentation
|
|
if: github.event_name == 'schedule'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Install Linux system dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
for i in 1 2 3 4 5; do
|
|
sudo apt-get update && break
|
|
echo "apt-get update failed (attempt $i); retrying in 15s"
|
|
sleep 15
|
|
done
|
|
sudo apt-get install -y libdbus-1-dev pkg-config
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-bin: false
|
|
- name: Build docs
|
|
run: cargo doc --workspace --no-deps
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|