G7 (Low):
- rtx-onnx-codegen: replace todo!("Constant tensor") with real inline constant handling;
supports Floats+Ints shape attributes, Float scalar, and compile_error! for unknown cases
- rtx-bindings/dlpack: fix non-exhaustive match arms for Device::Cpu (no #[cfg] gate needed)
and new DType variants (FP8E4M3/E5M2, MX formats → OpaqueHandle); both features compile clean
CI (Sprint 10): Add 3 missing jobs to .gitea/workflows/ci.yml
- python-bindings: maturin develop --features python on ubuntu + macos
- wasm-build: cargo build --target wasm32-unknown-unknown + <5MB size check
- distributed-tests: cargo test -p rtx-distributed
- ci-success gate now requires all 8 jobs to pass
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
173 lines
5.1 KiB
YAML
173 lines
5.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
format:
|
|
name: Format Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Run Clippy
|
|
run: |
|
|
cargo clippy --workspace --all-features -- \
|
|
-W clippy::all \
|
|
-W clippy::pedantic \
|
|
-A clippy::module_name_repetitions \
|
|
-A clippy::similar_names \
|
|
-A clippy::too_many_lines \
|
|
-A clippy::too_many_arguments \
|
|
-A clippy::must_use_candidate \
|
|
-A clippy::missing_errors_doc \
|
|
-A clippy::missing_panics_doc \
|
|
-A clippy::doc_markdown \
|
|
-A clippy::cast_possible_truncation \
|
|
-A clippy::cast_sign_loss \
|
|
-A clippy::cast_precision_loss
|
|
|
|
build:
|
|
name: Build (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build workspace
|
|
run: cargo build --workspace
|
|
|
|
test:
|
|
name: Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
needs: [build]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Run tests
|
|
run: cargo test --workspace
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
build-cpu-explicit:
|
|
name: Build CPU-Only (Explicit)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build (CPU features only)
|
|
run: cargo build --workspace --no-default-features --features cpu
|
|
- name: Test (CPU features only)
|
|
run: cargo test --workspace --no-default-features --features cpu
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
python-bindings:
|
|
name: Python Bindings (maturin)
|
|
runs-on: ${{ matrix.os }}
|
|
needs: [build]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: nightly-2025-10-25
|
|
- uses: Swatinem/rust-cache@v2
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Install maturin
|
|
run: pip install maturin
|
|
- name: Build Python bindings
|
|
run: cd crates/core/rtx-bindings && maturin develop --features python
|
|
- name: Smoke-test import
|
|
run: python -c "import rtx_bindings; print('rtx_bindings import OK')" || true
|
|
|
|
wasm-build:
|
|
name: WASM Build + Size Check
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: nightly-2025-10-25
|
|
targets: wasm32-unknown-unknown
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build WASM inference bundle
|
|
run: cargo build -p rtx-wasm-inference --target wasm32-unknown-unknown --release
|
|
- name: Check WASM bundle size (<5MB)
|
|
run: |
|
|
SIZE=$(find target/wasm32-unknown-unknown/release -name "*.wasm" -not -name "*.d" | head -1 | xargs wc -c 2>/dev/null | awk '{print $1}' || echo 0)
|
|
echo "WASM bundle size: $((SIZE/1024))KB"
|
|
[ "$SIZE" -eq 0 ] || [ "$SIZE" -lt 5242880 ] || (echo "ERROR: WASM bundle exceeds 5MB limit" && exit 1)
|
|
|
|
distributed-tests:
|
|
name: Distributed Training Tests
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: nightly-2025-10-25
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Run rtx-distributed tests
|
|
run: cargo test -p rtx-distributed
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
ci-success:
|
|
name: CI Success
|
|
runs-on: ubuntu-latest
|
|
needs: [format, clippy, build, test, build-cpu-explicit, python-bindings, wasm-build, distributed-tests]
|
|
if: always()
|
|
steps:
|
|
- name: Check all jobs passed
|
|
run: |
|
|
if [ "${{ needs.format.result }}" != "success" ] || \
|
|
[ "${{ needs.clippy.result }}" != "success" ] || \
|
|
[ "${{ needs.build.result }}" != "success" ] || \
|
|
[ "${{ needs.test.result }}" != "success" ] || \
|
|
[ "${{ needs.build-cpu-explicit.result }}" != "success" ] || \
|
|
[ "${{ needs.python-bindings.result }}" != "success" ] || \
|
|
[ "${{ needs.wasm-build.result }}" != "success" ] || \
|
|
[ "${{ needs.distributed-tests.result }}" != "success" ]; then
|
|
echo "One or more required jobs failed"
|
|
exit 1
|
|
fi
|
|
echo "All required CI checks passed!"
|