name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 0"
workflow_dispatch:
jobs:
rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Verify publishable manifests (no path deps)
run: |
if rg -n "path\\s*=\\s*\"" Cargo.toml crates/**/Cargo.toml tools/Cargo.toml; then
echo "Error: publishable manifests contain path deps."
exit 1
fi
- name: Check version consistency
run: |
# Extract workspace version from root Cargo.toml
WORKSPACE_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed -E 's/version = "(.*)"/\1/')
echo "Workspace version: $WORKSPACE_VERSION"
# Check all crate package versions match workspace version
echo "Checking crate package versions..."
MISMATCHED_CRATES=$(rg '^version = "' crates/*/Cargo.toml tools/Cargo.toml | grep -v "version = \"$WORKSPACE_VERSION\"" || true)
if [[ -n "$MISMATCHED_CRATES" ]]; then
echo "Error: Some crates have mismatched versions:"
echo "$MISMATCHED_CRATES"
exit 1
fi
# Check all internal cortenforge-* dependencies use workspace version
echo "Checking internal dependency versions..."
MISMATCHED_DEPS=$(rg 'cortenforge-[a-z-]+", version = "[0-9]+\.[0-9]+\.[0-9]+"' Cargo.toml crates/*/Cargo.toml tools/Cargo.toml | grep -v "version = \"$WORKSPACE_VERSION\"" || true)
if [[ -n "$MISMATCHED_DEPS" ]]; then
echo "Error: Some internal dependencies have mismatched versions:"
echo "$MISMATCHED_DEPS"
echo ""
echo "Run './scripts/sync_versions.sh --apply' to fix this."
exit 1
fi
echo "✓ All versions synchronized to $WORKSPACE_VERSION"
- name: Legacy feature alias lint (non-blocking)
run: |
if rg -n "burn_runtime|gpu_nvidia" README.md docs/cortenforge_book/src crates/**/README.md tools/README.md; then
echo "Warning: legacy feature names still present in docs. Update to burn-runtime/gpu-nvidia."
else
echo "Legacy feature names not found in docs."
fi
- name: fmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: tests (core)
run: >
cargo test --workspace --locked
--exclude cortenforge
--exclude cortenforge-sim-core
--exclude cortenforge-vision-runtime
--exclude cortenforge-tools
heavy-tests:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- name: Free disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
sudo apt-get clean
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install mdbook
run: cargo install mdbook --locked
- name: mdbook build (cortenforge)
run: mdbook build docs/cortenforge_book
- name: tests (full)
run: cargo test --workspace --locked --all-features
cargo-deny:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install cargo-deny
run: cargo install cargo-deny --version 0.19.0 --locked
- name: cargo deny check
run: cargo deny check