1+ name : Rust Tests
2+ on :
3+ push :
4+ branches :
5+ - main
6+ pull_request :
7+ paths :
8+ - rust/**
9+ - .github/workflows/rust-test.yml
10+ - Cargo.toml
11+ - Cargo.lock
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+ cancel-in-progress : true
16+
17+ env :
18+ CARGO_TERM_COLOR : always
19+ RUSTFLAGS : " -C debuginfo=1"
20+ RUST_BACKTRACE : " 1"
21+ CARGO_INCREMENTAL : " 0"
22+
23+ jobs :
24+ test :
25+ runs-on : ubuntu-24.04
26+ timeout-minutes : 30
27+ strategy :
28+ matrix :
29+ toolchain :
30+ - stable
31+ - nightly
32+ steps :
33+ - uses : actions/checkout@v4
34+ - name : Setup rust toolchain
35+ run : |
36+ rustup toolchain install ${{ matrix.toolchain }}
37+ rustup default ${{ matrix.toolchain }}
38+ - uses : Swatinem/rust-cache@v2
39+ with :
40+ workspaces : rust/lance-graph
41+ - name : Install dependencies
42+ run : |
43+ sudo apt update
44+ sudo apt install -y protobuf-compiler
45+ - name : Build tests
46+ run : cargo test --manifest-path rust/lance-graph/Cargo.toml --no-run
47+ - name : Run unit tests
48+ run : cargo test --manifest-path rust/lance-graph/Cargo.toml --lib
49+ - name : Run doc tests
50+ run : cargo test --manifest-path rust/lance-graph/Cargo.toml --doc
51+
52+ test-with-coverage :
53+ runs-on : ubuntu-24.04
54+ timeout-minutes : 30
55+ steps :
56+ - uses : actions/checkout@v4
57+ - name : Setup rust toolchain
58+ run : |
59+ rustup toolchain install stable
60+ rustup default stable
61+ - uses : Swatinem/rust-cache@v2
62+ with :
63+ workspaces : rust/lance-graph
64+ - name : Install dependencies
65+ run : |
66+ sudo apt update
67+ sudo apt install -y protobuf-compiler
68+ - name : Install cargo-llvm-cov
69+ uses : taiki-e/install-action@cargo-llvm-cov
70+ - name : Run tests with coverage
71+ run : |
72+ cargo llvm-cov --manifest-path rust/lance-graph/Cargo.toml --lcov --output-path lcov.info
73+ - name : Upload coverage to Codecov
74+ uses : codecov/codecov-action@v4
75+ with :
76+ files : lcov.info
77+ flags : rust-unittests
78+ fail_ci_if_error : false
0 commit comments