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
181
182
183
184
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
release-tag-guard:
name: Release tag guard
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Ensure release commits are tagged
run: |
set -euo pipefail
SUBJECT="$(git log -1 --pretty=%s "$GITHUB_SHA")"
TAG_NAME="$(printf '%s\n' "$SUBJECT" | sed -nE 's/^release: (v[0-9]+\.[0-9]+\.[0-9]+).*/\1/p')"
if [ -z "$TAG_NAME" ]; then
echo "HEAD commit is not a release commit; skipping tag guard."
exit 0
fi
if git tag --points-at "$GITHUB_SHA" | grep -Fxq "$TAG_NAME"; then
echo "Found matching tag ${TAG_NAME} on ${GITHUB_SHA}."
exit 0
fi
echo "::error::Release commit '${SUBJECT}' reached master without matching tag '${TAG_NAME}' pointing at ${GITHUB_SHA}."
echo "Tags currently pointing at ${GITHUB_SHA}:"
git tag --points-at "$GITHUB_SHA" || true
exit 1
check:
name: Check (fmt + clippy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libssl-dev
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-check-
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-features -- -D warnings
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os:
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libssl-dev
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-test-
- name: Cache fastembed model
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/
key: fastembed-allminilml6v2
- name: Run tests
run: cargo test --all-features
- name: Harness eval fixture suite
run: cargo test --lib harness_eval --all-features
build-check:
name: Build check (release)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libssl-dev
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: Build release
run: cargo build --release --features "browser"
coverage:
name: Code coverage
runs-on: ubuntu-latest
continue-on-error: true # Visibility only — doesn't block merges
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libssl-dev
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-cov-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-cov-
- name: Cache fastembed model
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/
key: fastembed-allminilml6v2
- name: Generate coverage
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}