test: Blitz valence-shell to CRG C (benchmarks + E2E + Zig/Elixir exp… #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: PMPL-1.0-or-later | |
| # Comprehensive Compilation Tests - Layer 8 | |
| # | |
| # Tests compilation across: | |
| # - Multiple Rust versions (stable, beta, nightly, MSRV) | |
| # - Multiple platforms (Linux, macOS, Windows) | |
| # - Different feature combinations | |
| # - Cross-compilation targets | |
| name: Compilation Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'impl/rust-cli/**' | |
| - '.github/workflows/compilation_tests.yml' | |
| pull_request: | |
| paths: | |
| - 'impl/rust-cli/**' | |
| - '.github/workflows/compilation_tests.yml' | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # ============================================================ | |
| # Matrix: Rust Versions × Platforms | |
| # ============================================================ | |
| test_matrix: | |
| name: Test (${{ matrix.rust }} on ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: [stable, beta, nightly] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust ${{ matrix.rust }} | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Cache cargo registry | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v4 | |
| with: | |
| path: impl/rust-cli/target | |
| key: ${{ runner.os }}-cargo-build-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build (debug) | |
| working-directory: impl/rust-cli | |
| run: cargo build --verbose | |
| - name: Build (release) | |
| working-directory: impl/rust-cli | |
| run: cargo build --release --verbose | |
| - name: Run tests | |
| working-directory: impl/rust-cli | |
| run: cargo test --verbose | |
| - name: Run ignored tests (stress) | |
| working-directory: impl/rust-cli | |
| run: cargo test --test stress_tests -- --ignored --test-threads=1 | |
| continue-on-error: true # Stress tests may timeout on slow runners | |
| # ============================================================ | |
| # MSRV (Minimum Supported Rust Version) | |
| # ============================================================ | |
| test_msrv: | |
| name: Test MSRV (1.70.0) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust 1.70.0 | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: 1.70.0 | |
| - name: Check MSRV compilation | |
| working-directory: impl/rust-cli | |
| run: cargo check --verbose | |
| # ============================================================ | |
| # Feature Combinations | |
| # ============================================================ | |
| test_features: | |
| name: Test Features | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| features: | |
| - "--no-default-features" | |
| - "--all-features" | |
| - "--features lean-runtime-checks" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: stable | |
| - name: Build with features | |
| working-directory: impl/rust-cli | |
| run: cargo build ${{ matrix.features }} --verbose | |
| - name: Test with features | |
| working-directory: impl/rust-cli | |
| run: cargo test ${{ matrix.features }} --verbose | |
| # ============================================================ | |
| # Cross-Compilation Targets | |
| # ============================================================ | |
| cross_compile: | |
| name: Cross-compile (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - x86_64-unknown-linux-musl # Alpine Linux | |
| - aarch64-unknown-linux-gnu # ARM64 Linux | |
| - x86_64-apple-darwin # macOS x64 | |
| - aarch64-apple-darwin # macOS ARM (M1/M2) | |
| - x86_64-pc-windows-gnu # Windows x64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: stable | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Cross-compile | |
| working-directory: impl/rust-cli | |
| run: cross build --target ${{ matrix.target }} --verbose | |
| # ============================================================ | |
| # Clippy & Rustfmt | |
| # ============================================================ | |
| lint: | |
| name: Lint (clippy + rustfmt) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust stable with clippy & rustfmt | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| - name: Run clippy | |
| working-directory: impl/rust-cli | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Check formatting | |
| working-directory: impl/rust-cli | |
| run: cargo fmt -- --check | |
| # ============================================================ | |
| # Documentation Build | |
| # ============================================================ | |
| docs: | |
| name: Build documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: stable | |
| - name: Build docs | |
| working-directory: impl/rust-cli | |
| run: cargo doc --no-deps --all-features --verbose | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| # ============================================================ | |
| # Build Artifacts (Release) | |
| # ============================================================ | |
| build_release: | |
| name: Build release artifacts | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact: vsh-linux-x64 | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact: vsh-macos-x64 | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact: vsh-windows-x64.exe | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b | |
| with: | |
| toolchain: stable | |
| targets: ${{ matrix.target }} | |
| - name: Build release | |
| working-directory: impl/rust-cli | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: impl/rust-cli/target/${{ matrix.target }}/release/vsh${{ matrix.os == 'windows-latest' && '.exe' || '' }} | |
| retention-days: 30 |