Skip to content

Reuse batch result initialization helper #148

Reuse batch result initialization helper

Reuse batch result initialization helper #148

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
jobs:
build-test:
name: build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install RocksDB build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev cmake
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Build
run: cargo build --all-targets --locked
- name: Test (default / RocksDB SSD backend)
run: cargo test --locked
- name: Test (no default features / compatibility store)
run: cargo test --locked --no-default-features
- name: Grafana dashboard validation
run: tools/validate_grafana_dashboard.py
- name: Soak report smoke
run: |
cargo run --locked --no-default-features --example soak -- 1 1 \
--duration-seconds 2 \
--sample-seconds 1 \
--json-output /tmp/matrixcache-soak.json \
--require-passed \
--max-get-p99-us 1000000 \
--max-put-p99-us 1000000 \
--max-read-through-p99-us 1000000 \
--min-hit-rate-percent 1
tools/validate_soak_report.py /tmp/matrixcache-soak.json \
--max-get-p99-us 1000000 \
--max-put-p99-us 1000000 \
--max-read-through-p99-us 1000000 \
--min-hit-rate-percent 1 \
--min-reads 1000 \
--min-writes 100 \
--min-memory-evictions 1 \
--min-get-samples 1000 \
--min-put-samples 100 \
--min-read-through-samples 1000 \
--min-eviction-samples 1
tools/compare_soak_reports.py /tmp/matrixcache-soak.json /tmp/matrixcache-soak.json
- name: Backend report smoke
run: |
cargo run --locked --no-default-features --example rocksdb_backend_bench -- \
--iterations 500 \
--replacement-soak-iterations 128 \
--json-output /tmp/matrixcache-backend-compat.json \
--require-passed
tools/validate_backend_report.py /tmp/matrixcache-backend-compat.json \
--expect-backend file-compat \
--min-iterations 500 \
--min-replacement-soak-iterations 128 \
--min-cold-ssd-refills 1 \
--min-memory-evictions 1 \
--min-pmem-evictions 1 \
--min-disk-fills 1 \
--min-async-writeback-backpressure 1 \
--max-refill-failures 0
- name: Batch control report smoke
run: |
cargo run --locked --no-default-features --example batch_write_cost -- \
--json-output /tmp/matrixcache-batch-control.json \
--require-passed
tools/validate_batch_control_report.py /tmp/matrixcache-batch-control.json \
--min-batches 2 \
--min-disk-hits 1 \
--min-zero-copy-hits 1 \
--min-refill-samples 1 \
--min-passes 9
tools/compare_batch_control_reports.py \
/tmp/matrixcache-batch-control.json \
/tmp/matrixcache-batch-control.json
- name: Read scaling report smoke
run: |
cargo run --locked --no-default-features --example cache_scaling_bench -- \
1024 \
--json-output /tmp/matrixcache-read-scaling.json \
--require-passed \
--min-sharded-speedup 0.25 \
--max-single-thread-ns 1000000
tools/validate_read_scaling_report.py /tmp/matrixcache-read-scaling.json \
--min-hit-costs 1 \
--min-thread-rows 4 \
--min-max-threads 8 \
--min-worst-sharded-speedup 0.25 \
--max-first-hit-ns 1000000 \
--min-repeats 5
tools/compare_read_scaling_reports.py \
/tmp/matrixcache-read-scaling.json \
/tmp/matrixcache-read-scaling.json
- name: Read path report smoke
run: |
cargo run --locked --no-default-features --example read_path_cost -- \
1024 \
--json-output /tmp/matrixcache-read-path.json \
--require-passed \
--max-full-ns 1000000 \
--max-overhead-percent 1000000 \
--max-spread-percent 1000000
tools/validate_read_path_report.py /tmp/matrixcache-read-path.json \
--max-full-ns 1000000 \
--max-overhead-percent 1000000 \
--max-spread-percent 1000000 \
--min-passes 7 \
--min-entries 1024
tools/compare_read_path_reports.py \
/tmp/matrixcache-read-path.json \
/tmp/matrixcache-read-path.json
- name: Eviction report smoke
run: |
cargo run --locked --no-default-features --example eviction_bench -- \
--smoke \
--json-output /tmp/matrixcache-eviction.json \
--require-passed \
--max-ns-per-write 2000000 \
--max-groups-per-eviction 128 \
--min-hit-rate-percent 70
tools/validate_eviction_report.py /tmp/matrixcache-eviction.json \
--min-steady-rows 3 \
--min-hit-rate-rows 2 \
--min-write-pressure-writes 256 \
--min-read-pressure-reads 20000 \
--max-ns-per-write 2000000 \
--max-groups-per-eviction 128 \
--min-hit-rate-percent 70
tools/compare_eviction_reports.py \
/tmp/matrixcache-eviction.json \
/tmp/matrixcache-eviction.json
- name: Doc
run: cargo doc --no-deps --locked
msrv:
name: msrv (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.88.0
- name: Install RocksDB build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev cmake
- uses: Swatinem/rust-cache@v2
- name: Check on MSRV
run: cargo check --all-targets --locked
deny:
name: cargo-deny (licenses & advisories)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check bans licenses sources advisories
coverage:
name: coverage (informational)
runs-on: ubuntu-latest
# Informational: reports line/region coverage but does not gate merges.
continue-on-error: true
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install RocksDB build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev cmake
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
- name: Coverage summary
run: cargo llvm-cov --locked --summary-only
license-headers:
name: license headers (SPDX)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Verify SPDX Apache-2.0 header on all Rust sources
shell: bash
run: |
set -euo pipefail
files=$(git ls-files '*.rs')
if [ -z "$files" ]; then
echo "No Rust sources found."; exit 0
fi
missing=$(grep -L 'SPDX-License-Identifier: Apache-2.0' $files || true)
if [ -n "$missing" ]; then
echo "The following Rust sources are missing the SPDX Apache-2.0 header:"
echo "$missing"
exit 1
fi
echo "OK: all $(echo "$files" | wc -l) Rust sources carry the SPDX Apache-2.0 header."