name: source-pr on: pull_request: branches: [next, main] 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:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948 env: CARGO_TARGET_DIR: target steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Detect changed surface id: surface run: python3 ci/pr_surface.py >> "$GITHUB_OUTPUT" - name: Check patch whitespace run: | if [ "${GITHUB_EVENT_NAME:-}" = pull_request ]; then base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF")" git diff --check "$base" HEAD else git diff --check HEAD^ HEAD fi - name: Check CI and evidence tools if: steps.surface.outputs.surface != 'documentation' run: | python3 -m compileall -q ci for test in ci/test-*.py; do python3 "$test"; done python3 ci/evidence_status.py python3 ci/experiment_priority.py - name: Install source formatter if: steps.surface.outputs.surface == 'rust' run: rustup component add rustfmt - name: Check source formatting if: steps.surface.outputs.surface == 'rust' run: cargo fmt --check - name: Check changed Rust source if: steps.surface.outputs.surface == 'rust' run: | if [ "${GITHUB_BASE_REF:-}" = main ]; then cargo build --release --offline --locked else cargo check --offline --locked fi - name: Clean generated build if: always() run: python3 ci/cleanup-generated.py