name: CI on: push: branches: [main] pull_request: branches: [main] env: CARGO_TERM_COLOR: always RUSTFLAGS: -Dwarnings jobs: dco: runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: DCO Sign-Off Check run: | COMMITS=$(git log --format='%H %s' origin/main..HEAD 2>/dev/null || echo "") if [ -z "$COMMITS" ]; then echo "No new commits to check" exit 0 fi FAILED=0 while IFS= read -r line; do HASH=$(echo "$line" | cut -d' ' -f1) MSG=$(git log -1 --format='%B' "$HASH") if ! echo "$MSG" | grep -q "Signed-off-by:"; then echo "Missing DCO sign-off: $line" FAILED=1 fi done <<< "$COMMITS" if [ "$FAILED" -eq 1 ]; then echo "All commits must include Signed-off-by. Use: git commit -s" exit 1 fi echo "All commits have DCO sign-off" build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Cache cargo uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- - name: Check formatting run: cargo fmt --all --check - name: Build (default features) run: cargo build --release -p bascule-server - name: Build (all features) run: cargo build --release -p bascule-server --features agent-id - name: Clippy run: cargo clippy --all-targets --all-features -- -D warnings - name: Tests run: cargo test --all - name: Binary size run: ls -lh target/release/bascule - name: Substrate contamination check run: | count=$(grep -c "substrate\|chronicle\|gsap\|hfl\|metakernel" Cargo.lock || true) if [ "$count" -gt 0 ]; then echo "ERROR: Substrate dependencies found in Cargo.lock" exit 1 fi