- queue_index: mmap-based priority queue with safe storage wrapper - dataset_hash: BLAKE3 parallel hashing with rayon - common: FFI utilities with panic recovery - Minimal deps: ~20 total (rayon, blake3, memmap2, walkdir, chrono) - Drop crossbeam, prometheus - use stdlib + manual metrics - Makefile: cargo build targets, help text updated - Forgejo CI: clippy, tests, miri, cargo-deny - C FFI compatible with existing Go bindings
116 lines
2.7 KiB
YAML
116 lines
2.7 KiB
YAML
name: Rust Native CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'native/rust/**'
|
|
- '.forgejo/workflows/rust-native.yml'
|
|
pull_request:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'native/rust/**'
|
|
|
|
jobs:
|
|
rust-ci:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
toolchain: 1.85.0
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
native/rust/target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('native/rust/**/Cargo.lock') }}
|
|
|
|
- name: Check formatting
|
|
run: cd native/rust && cargo fmt --check
|
|
|
|
- name: Run clippy
|
|
run: cd native/rust && cargo clippy -- -D warnings
|
|
|
|
- name: Run tests
|
|
run: cd native/rust && cargo test
|
|
|
|
- name: Build release
|
|
run: cd native/rust && cargo build --release
|
|
|
|
miri:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust nightly with Miri
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: miri
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
native/rust/target
|
|
key: ${{ runner.os }}-cargo-miri-${{ hashFiles('native/rust/**/Cargo.lock') }}
|
|
|
|
- name: Run Miri tests
|
|
run: |
|
|
cd native/rust
|
|
cargo miri test
|
|
|
|
cargo-deny:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run cargo-deny
|
|
uses: EmbarkStudios/cargo-deny-action@v1
|
|
with:
|
|
command: check
|
|
manifest-path: native/rust/Cargo.toml
|
|
|
|
cross-platform:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
toolchain: 1.85.0
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
native/rust/target
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('native/rust/**/Cargo.lock') }}
|
|
|
|
- name: Build
|
|
run: cd native/rust && cargo build --release
|
|
|
|
- name: Test
|
|
run: cd native/rust && cargo test
|