Repository navigation
feat(kpm): implement Hough similarity voting algorithm (M7) #391
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: Rust CI | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: [ "v*" ] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo fmt check | |
| run: cargo fmt --all -- --check | |
| - name: Run cargo clippy | |
| run: cargo clippy --workspace -- -D warnings | |
| - name: Run cargo check | |
| run: cargo check --workspace | |
| - name: Run cargo test | |
| run: cargo test --workspace | |
| - name: Run cargo test with SIMD | |
| run: cargo test --workspace --features simd | |
| kpm-build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install libclang (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libclang-dev | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build kpm backend (FFI backend) | |
| run: cargo build -p webarkitlib-rs --features ffi-backend | |
| submodule-drift-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Verify submodule SHA matches libraries.json commit | |
| run: | | |
| SUB=$(git -C crates/core/third_party/WebARKitLib rev-parse HEAD) | |
| JSON=$(jq -r '.[] | select(.name=="WebARKitLib") | .source.commit' \ | |
| benchmarks/c_benchmark/libraries.json) | |
| if [ "$SUB" != "$JSON" ]; then | |
| echo "::error::Submodule SHA ($SUB) does not match libraries.json commit ($JSON)" | |
| echo "Run: git -C crates/core/third_party/WebARKitLib rev-parse HEAD" | |
| echo "Then update benchmarks/c_benchmark/libraries.json accordingly." | |
| exit 1 | |
| fi | |
| echo "OK: submodule and libraries.json both pinned at $SUB" | |
| wasm-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: | | |
| curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Build WASM module (Dual Mode) | |
| run: npm run build:wasm | |
| - name: Upload WASM Package | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: wasm-package | |
| path: crates/wasm/pkg | |
| native-example: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Run native simple example | |
| working-directory: crates/core | |
| run: cargo run --example simple --features log-helpers | |
| benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Generate hiro.raw for C benchmark | |
| working-directory: crates/core | |
| run: cargo run --example simple --features log-helpers -- ../../benchmarks/data/camera_para.dat ../../benchmarks/data/patt.hiro ../../benchmarks/data/img.jpg | |
| - name: Run benchmarks | |
| run: | | |
| # Download and Build C benchmark | |
| cd benchmarks/c_benchmark | |
| python ../bootstrap.py --bootstrap-file libraries.json | |
| mkdir -p build && cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make | |
| cd .. | |
| # Run C benchmark for baseline | |
| mkdir -p ../../target/criterion | |
| ./build/c_benchmark ../data/camera_para.dat ../data/patt.hiro ../data/hiro.raw 429 317 > ../../target/criterion/c_benchmark.log | |
| # Run Rust benchmarks | |
| cd ../.. | |
| cargo bench -p webarkitlib-rs --bench marker_bench | |
| - name: Upload benchmark reports | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: benchmark-reports | |
| path: target/criterion |