forked from lance-format/lance-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (175 loc) · 7.92 KB
/
Copy pathrust-test.yml
File metadata and controls
180 lines (175 loc) · 7.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Rust Tests
on:
push:
branches:
- main
pull_request:
paths:
- crates/**
- Cargo.toml
- Cargo.lock
- .github/workflows/rust-test.yml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C debuginfo=1 -C target-cpu=x86-64-v3"
RUST_BACKTRACE: "1"
CARGO_INCREMENTAL: "0"
# Least-privilege: these jobs only read the repo (checkout + build + test).
# Codecov upload uses its own token secret and is non-fatal (fail_ci_if_error: false).
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
# Override the workflow-level debuginfo=1 for this job too (parity with
# test-with-coverage, TD-CI-COVERAGE-MOLD-1). The `test` job links the
# full lance+datafusion integration-test set at the SAME disk/RSS cliff
# the coverage job hit — and #507 (+4055 lines across causal-edge +
# cognitive-shader-driver: ce64-v2 layout + MailboxSoaOwner/
# SurrealMailboxView) grew that link footprint enough to tip the
# previously-marginal link into a hard `ld` SIGBUS (signal 7 = object
# file truncated when the runner partition fills mid-link). debuginfo=1
# carried no value here (CI never opens a debugger); dropping it cut the
# coverage job's per-binary link from ~930 MB to ~252 MB (-73%, measured
# in b56bb2cd) and relieves BOTH ceilings (mold/GNU-ld RSS + disk). mold
# is already installed below. Note: a job-level RUSTFLAGS gives this job
# its own Swatinem cache key — the first run after this change
# repopulates the test cache.
RUSTFLAGS: "-C debuginfo=0 -C target-cpu=x86-64-v3"
defaults:
run:
working-directory: lance-graph
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v4
with:
path: lance-graph
- name: Checkout AdaWorldAPI/ndarray (sibling dependency)
uses: actions/checkout@v4
with:
repository: AdaWorldAPI/ndarray
# ndarray master now exports wht_f32, kmeans, squared_l2,
# dequantize_i8_to_f32, quantize_f32_to_i2, dequantize_i2_to_f32
# publicly (ndarray PR #115, merged 2026-04-30). Pin retired.
path: ndarray
- name: Setup rust toolchain
run: |
rustup toolchain install ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
- name: Setup mold linker
# Heavy lance+datafusion integration-test binaries OOM the default GNU `ld`
# at the `cargo test --no-run` link step (intermittent). mold links them
# fast + low-memory (already used by release.yml / rust-publish.yml).
uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: "lance-graph-deps"
workspaces: |
lance-graph/crates/lance-graph
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Build tests
run: cargo test --manifest-path crates/lance-graph/Cargo.toml --no-run
- name: Run unit tests
run: cargo test --manifest-path crates/lance-graph/Cargo.toml --lib
- name: Run doc tests
run: cargo test --manifest-path crates/lance-graph/Cargo.toml --doc
# lance-graph-contract is the zero-dep trait crate every workspace
# consumer (planner, callcenter, shader-driver, ...) depends on.
# Its clippy gate (style.yml) catches type errors but does NOT
# execute tests, so a logically-broken assertion can ship green —
# PR #322's `log_norm_growth_negative_when_m_attenuates` slipped
# through exactly this way and was caught only after merge.
# Adding the test gate here closes that hole. Cost is minimal:
# zero-dep crate, ~1 s build + <1 s test execution, reuses the
# already-installed toolchain and Swatinem cache from above.
- name: Run contract unit tests
run: cargo test --manifest-path crates/lance-graph-contract/Cargo.toml --lib
# Per PR #431 review: the `compile_fail` typestate proofs in
# `tests/cognition_typestate.rs` and the integration test bodies
# themselves were silently un-gated by `--lib`. Adding `--tests`
# picks up the integration crate; `--doc` picks up doctest /
# compile_fail blocks in library modules.
- name: Run contract integration tests
run: cargo test --manifest-path crates/lance-graph-contract/Cargo.toml --tests
- name: Run contract doctests
run: cargo test --manifest-path crates/lance-graph-contract/Cargo.toml --doc
# deepnsm: standalone 0-dep codec crate, workspace-excluded, so the
# lance-graph test steps above never reached it. ~217 lib + integration +
# doctests, fast (no lance/datafusion/ndarray deps). Gating.
- name: Run deepnsm tests
run: cargo test --manifest-path crates/deepnsm/Cargo.toml
test-with-coverage:
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
# Override the workflow-level debuginfo=1 for this job only. llvm-cov
# coverage lives in __llvm_covmap/__llvm_prf_* ELF sections, NOT in
# DWARF (verified locally: 600/600 contract tests pass under
# `-C instrument-coverage -C debuginfo=0`, covmap sections present,
# .profraw emitted). At debuginfo=1 each of the 17 instrumented
# integration-test binaries links to ~930 MB (measured; ~252 MB at
# debuginfo=0, -73%) — the full set + deps tree sits exactly at the
# hosted runner's disk/RSS cliff, which is the 2/50 intermittent
# exit-101 (TD-CI-COVERAGE-MOLD-1). Dropping debuginfo relieves BOTH
# ceilings (GNU-ld/mold RSS at link, and disk). Note: a job-level
# RUSTFLAGS gives this job its own Swatinem cache key — the first run
# after this change repopulates the coverage cache.
RUSTFLAGS: "-C debuginfo=0 -C target-cpu=x86-64-v3"
defaults:
run:
working-directory: lance-graph
steps:
- uses: actions/checkout@v4
with:
path: lance-graph
- name: Checkout AdaWorldAPI/ndarray (sibling dependency)
uses: actions/checkout@v4
with:
repository: AdaWorldAPI/ndarray
# ndarray master now exports wht_f32, kmeans, squared_l2,
# dequantize_i8_to_f32, quantize_f32_to_i2, dequantize_i2_to_f32
# publicly (ndarray PR #115, merged 2026-04-30). Pin retired.
path: ndarray
- name: Setup rust toolchain
run: |
rustup toolchain install stable
rustup default stable
- name: Setup mold linker
# Parity with the `test` job above (TD-CI-COVERAGE-MOLD-1): the heavy
# lance+datafusion test binaries OOM the default GNU `ld` at link
# (intermittent) — and llvm-cov INSTRUMENTED binaries are larger, so
# the OOM is MORE likely here than in the plain `test` job that already
# has mold. Without this step the coverage job flaked while `test`
# stayed green (2/50 runs). mold links them fast + low-memory.
uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: "lance-graph-deps"
workspaces: |
lance-graph/crates/lance-graph
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests with coverage
run: |
cargo llvm-cov --manifest-path crates/lance-graph/Cargo.toml --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
flags: rust-unittests
fail_ci_if_error: false