Rename document format from Codex to CDX #312
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build workspace | |
| run: cargo build --workspace --all-features | |
| - name: Run tests | |
| run: cargo test --workspace --all-features | |
| lint: | |
| name: Lint | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-features -- -D warnings | |
| docs: | |
| name: Documentation | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build docs | |
| run: cargo doc --workspace --no-deps --all-features | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| msrv: | |
| name: MSRV (1.88) | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Rust 1.88 | |
| uses: dtolnay/rust-toolchain@1.88 | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --workspace --all-features | |
| wasm: | |
| name: WASM Build | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build cdx-core for WASM | |
| run: cargo build -p cdx-core --target wasm32-unknown-unknown --features wasm --no-default-features | |
| cli-tests: | |
| name: CLI Integration Tests | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build CLI | |
| run: cargo build -p cdx-cli --release | |
| - name: Run CLI tests | |
| run: cargo test -p cdx-cli | |
| coverage: | |
| name: Coverage | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Generate coverage | |
| run: cargo tarpaulin --workspace --all-features --out xml --timeout 180 | |
| continue-on-error: true | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: cobertura.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| swift-bridge: | |
| name: Swift Bridge | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: cdx-swift-bridge -> cdx-swift-bridge/target | |
| - name: Build Swift bridge | |
| run: cargo build --manifest-path cdx-swift-bridge/Cargo.toml | |
| - name: Test Swift bridge | |
| run: cargo test --manifest-path cdx-swift-bridge/Cargo.toml | |
| - name: Clippy Swift bridge | |
| run: cargo clippy --manifest-path cdx-swift-bridge/Cargo.toml -- -D warnings | |
| security: | |
| name: Security Audit | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked || true | |
| - name: Audit dependencies | |
| run: cargo audit --ignore RUSTSEC-2023-0071 --ignore RUSTSEC-2026-0037 | |
| - name: Install cargo-deny | |
| run: cargo install cargo-deny --locked || true | |
| - name: Check dependency policies | |
| run: cargo deny check | |
| benchmark: | |
| name: Benchmark | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Restore baseline | |
| uses: actions/cache@v5 | |
| with: | |
| path: target/criterion | |
| key: benchmark-baseline-${{ github.base_ref || 'main' }} | |
| restore-keys: benchmark-baseline-main | |
| - name: Run benchmarks | |
| run: cargo bench -p cdx-core --bench document -- --save-baseline pr | |
| - name: Compare benchmarks | |
| run: | | |
| if [ -d "target/criterion" ] && [ -f "target/criterion/main/estimates.json" ]; then | |
| echo "Comparing against baseline..." | |
| cargo bench -p cdx-core --bench document -- --baseline main --noplot 2>&1 | tee benchmark_results.txt || true | |
| else | |
| echo "No baseline found, skipping comparison" | |
| fi | |
| continue-on-error: true | |
| - name: Save baseline | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/cache@v5 | |
| with: | |
| path: target/criterion | |
| key: benchmark-baseline-main | |
| feature-matrix: | |
| name: Feature Matrix (${{ matrix.features || 'no features' }}) | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| features: | |
| - "" | |
| - "zstd" | |
| - "signatures" | |
| - "zstd,signatures" | |
| - "signatures,encryption" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: features-${{ matrix.features }} | |
| - name: Build | |
| run: cargo build -p cdx-core --no-default-features --features "${{ matrix.features }}" | |
| - name: Test | |
| run: cargo test -p cdx-core --no-default-features --features "${{ matrix.features }}" |