-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (158 loc) · 5.67 KB
/
ci-minimal.yml
File metadata and controls
191 lines (158 loc) · 5.67 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
181
182
183
184
185
186
187
188
189
190
191
name: CI (Minimal)
on:
push:
branches: [main, "release/*", "feature/*", "feat/*", "fix/*"]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: "-D warnings"
CARGO_TERM_COLOR: always
jobs:
# Fast compilation check on MSRV and stable
check:
name: Check (${{ matrix.rust }})
runs-on: [self-hosted, Linux, X64, fedora, nobara]
strategy:
matrix:
rust: [stable] # Use stable only
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Get Rust version
id: rust-version
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.rust-version.outputs.version }}
- name: Type check
run: cargo check --workspace --all-targets --locked
- name: Build
run: cargo build --workspace --locked
# Linting and formatting (stable only)
lint:
name: Lint & Format
runs-on: [self-hosted, Linux, X64, fedora, nobara]
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Get Rust version
id: rust-version
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.rust-version.outputs.version }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Build docs
run: cargo doc --workspace --no-deps --locked
# Unit and integration tests (not E2E)
test:
name: Test
runs-on: [self-hosted, Linux, X64, fedora, nobara]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Get Rust version
id: rust-version
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.rust-version.outputs.version }}
# Core build dependencies only (no X11/text injection stuff)
- name: Verify core deps
run: |
set -euo pipefail
for cmd in gcc g++ make pkg-config; do
command -v $cmd || { echo "Missing: $cmd"; exit 1; }
done
pkg-config --exists alsa || { echo "Missing: libalsa-dev"; exit 1; }
- name: Run tests
run: |
# Use nextest if available, otherwise fallback
if command -v cargo-nextest &>/dev/null; then
cargo nextest run --workspace --locked
else
cargo test --workspace --locked
fi
# Optional: Text injection tests (only if tools available)
text-injection:
name: Text Injection (Optional)
runs-on: [self-hosted, Linux, X64, fedora, nobara]
continue-on-error: true # Don't fail CI if this fails
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Get Rust version
id: rust-version
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.rust-version.outputs.version }}
- name: Check if tools available
id: check_tools
run: |
has_tools=true
for tool in xdotool Xvfb openbox; do
if ! command -v $tool &>/dev/null; then
echo "Missing: $tool"
has_tools=false
fi
done
echo "available=$has_tools" >> $GITHUB_OUTPUT
- name: Run text injection tests
if: steps.check_tools.outputs.available == 'true'
env:
DISPLAY: :99
run: |
# Start headless X server
Xvfb :99 -screen 0 1024x768x24 &
sleep 2
openbox &
sleep 1
cargo test -p coldvox-text-injection --locked
- name: Skip text injection tests
if: steps.check_tools.outputs.available != 'true'
run: echo "⚠️ Skipping - X11 tools not available"
# Optional: Whisper E2E tests (only if model available)
whisper-e2e:
name: Whisper E2E (Optional)
runs-on: [self-hosted, Linux, X64, fedora, nobara]
continue-on-error: true # Don't fail CI if this fails
env:
WHISPER_MODEL_SIZE: tiny # Use tiny model for minimal CI
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- name: Get Rust version
id: rust-version
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.rust-version.outputs.version }}
- name: Setup Whisper model
id: setup
run: bash scripts/ci/setup-whisper-cache.sh
- name: Run Whisper Golden Master test
env:
WHISPER_MODEL_PATH: ${{ steps.setup.outputs.model_path }}
WHISPER_MODEL_SIZE: ${{ steps.setup.outputs.model_size }}
run: |
pip install faster-whisper
export PYTHONPATH=$(python3 -c "import site; print(site.getsitepackages()[0])")
cargo test -p coldvox-app --test golden_master -- --nocapture
- name: Skip Whisper E2E
if: steps.setup.outputs.model_path == ''
run: echo "⚠️ Skipping - Whisper model not available"