-
-
Notifications
You must be signed in to change notification settings - Fork 6
322 lines (292 loc) · 12.9 KB
/
cli-smoke.yml
File metadata and controls
322 lines (292 loc) · 12.9 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: CLI Smoke Test
on:
push:
branches: [main]
paths:
- 'src-tauri/src/bin/aeroftp_cli.rs'
- 'src-tauri/src/providers/**'
- 'src-tauri/Cargo.toml'
- '.github/workflows/cli-smoke.yml'
pull_request:
branches: [main]
paths:
- 'src-tauri/src/bin/aeroftp_cli.rs'
- 'src-tauri/src/providers/**'
- 'src-tauri/Cargo.toml'
- '.github/workflows/cli-smoke.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
smoke:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cli_bin: ./target/release/aeroftp-cli
- os: macos-latest
cli_bin: ./target/release/aeroftp-cli
# Pin to windows-2022 while cmake-rs (crate `cmake` 0.1.58 used
# transitively by whisper-rs-sys 0.15.0) hardcodes the generator
# string `Visual Studio 18 2026` whenever it detects MSVC v18 on
# the runner, but CMake itself does not yet know that generator.
# Symptom on windows-latest after the GitHub-hosted image
# picked up VS 18 preview:
# CMake Error: Could not create named generator Visual Studio 18 2026
# windows-2022 still ships VS 17 2022, which both cmake-rs and
# CMake support. Revisit when cmake-rs upstream ships VS 18 +
# CMake adds the generator. The cache prefix-key bump above
# remains as defence in depth against the related stale
# CMakeCache class of failure.
- os: windows-2022
cli_bin: ./target/release/aeroftp-cli.exe
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Rust cache
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
workspaces: './src-tauri -> target'
# Cache prefix bumped 2026-05-06 to invalidate any cached
# whisper-rs-sys CMakeCache.txt referencing Visual Studio 17 2022
# after the windows-latest runner image rolled to VS 18 2026.
# See "Drop stale whisper-rs-sys CMake artifacts" below for the
# belt-and-suspenders runtime cleanup. Mirrored from build.yml.
prefix-key: 'v2-whisper-vs18'
# whisper-rs-sys vendors whisper.cpp and runs CMake at build time. The
# generator picked by cmake-rs is whichever Visual Studio CMake finds
# first on the runner. When the windows-latest image rolls to a new
# VS (e.g. VS 17 2022 -> VS 18 2026 preview), the rust-cache restored
# CMakeCache.txt still references the previous generator and CMake
# aborts: "generator does not match the generator used previously".
# Belt-and-suspenders: even with the prefix-key bump we drop the
# whole whisper-rs-sys-* tree on Windows to force a clean reconfigure,
# in case a future cache key collision restores stale artifacts.
# Removing only out/ previously left out/build/CMakeCache.txt behind
# on some runners depending on cmake-rs internal layout, so we nuke
# the entire crate build dir. Mirrored from build.yml.
- name: Drop stale whisper-rs-sys CMake artifacts (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$base = "src-tauri/target/release/build"
$purged = 0
if (Test-Path $base) {
Get-ChildItem $base -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -like 'whisper-rs-sys-*' } |
ForEach-Object {
Write-Host "Removing whole whisper-rs-sys build dir: $($_.FullName)"
Remove-Item -Recurse -Force $_.FullName -ErrorAction SilentlyContinue
$purged++
}
Write-Host "Purged $purged whisper-rs-sys build dir(s)"
} else {
Write-Host "No prior build dir, nothing to purge"
}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev
# Windows only: openssl-sys (vendored via ssh2) needs a Perl with the
# Locale::Maketext::Simple / Params::Check modules to configure OpenSSL.
# The Git-for-Windows Perl that `shell: bash` picks up is missing those
# modules (BEGIN failed at Params/Check.pm). Strawberry Perl ships them,
# but after `choco install` the Strawberry bin dirs only hit the PATH of
# newly-spawned steps: we also have to prepend them to GITHUB_PATH so
# they actually win against Git Bash's Perl on the next step's lookup.
- name: Install Strawberry Perl (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install strawberryperl -y --no-progress
"C:\Strawberry\perl\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
"C:\Strawberry\perl\site\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
"C:\Strawberry\c\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build CLI
working-directory: src-tauri
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
# Force Strawberry Perl ahead of Git-for-Windows /usr/bin/perl so
# openssl-src's Configure script finds Locale::Maketext::Simple.
export PATH="/c/Strawberry/perl/bin:/c/Strawberry/perl/site/bin:/c/Strawberry/c/bin:$PATH"
which perl
perl -e 'use Locale::Maketext::Simple; print "OK\n"'
fi
cargo build --release --bin aeroftp-cli
- name: Version and help smoke
working-directory: src-tauri
shell: bash
env:
CLI_BIN: ${{ matrix.cli_bin }}
run: |
"$CLI_BIN" --version
"$CLI_BIN" --help > /dev/null
"$CLI_BIN" sync --help > /dev/null
"$CLI_BIN" reconcile --help > /dev/null
"$CLI_BIN" agent-info --json > /dev/null
"$CLI_BIN" profiles --json > /dev/null || true
# R10 (APPENDIX-CLI-DISPATCH): the version baked into the CLI binary
# must match the [package].version declared in src-tauri/Cargo.toml.
# Drift would mean cargo and the installed payload disagree, which
# confuses cargo install, update checks, and the AUR pkgver bump.
- name: R10 version match (binary vs Cargo.toml)
working-directory: src-tauri
shell: bash
env:
CLI_BIN: ${{ matrix.cli_bin }}
run: |
EXPECTED=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
ACTUAL=$("$CLI_BIN" --version | awk '{print $NF}')
echo "Cargo.toml version: $EXPECTED"
echo "CLI binary version: $ACTUAL"
if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "::error::R10 version mismatch: Cargo.toml=$EXPECTED CLI=$ACTUAL"
exit 1
fi
- name: Batch parser smoke
working-directory: src-tauri
shell: bash
env:
CLI_BIN: ${{ matrix.cli_bin }}
run: |
cat > smoke-test.aeroftp <<'EOF'
SET host = example.com
ECHO Host is $host
EOF
"$CLI_BIN" batch smoke-test.aeroftp > /dev/null
- name: Share link verify flag smoke
working-directory: src-tauri
shell: bash
env:
CLI_BIN: ${{ matrix.cli_bin }}
run: |
# Just confirm the --verify flag is wired into the link subcommand;
# actual live probes against real providers require credentialed
# profiles and run on the operator's machine, not in CI.
# Capture help to a tempfile so `set -o pipefail` cannot bite us
# on macOS, where `clap` writes the long form to stdout but the
# tail of a piped paginator-style buffer was being dropped before
# grep could see it.
HELP_OUT=$(mktemp)
"$CLI_BIN" link --help > "$HELP_OUT" 2>&1
if ! grep -q -- '--verify' "$HELP_OUT"; then
echo "::error::aeroftp link is missing --verify flag"
echo "--- link --help dump (last 30 lines) ---"
tail -30 "$HELP_OUT"
echo "--- end ---"
exit 1
fi
- name: Shell completions smoke
working-directory: src-tauri
shell: bash
env:
CLI_BIN: ${{ matrix.cli_bin }}
run: |
"$CLI_BIN" completions bash > /dev/null
"$CLI_BIN" completions zsh > /dev/null
"$CLI_BIN" completions fish > /dev/null
# R11 (APPENDIX-CLI-DISPATCH): `cargo install --path src-tauri --bin
# aeroftp-cli` is the path developers and AUR maintainers use to get
# just the CLI binary out of the workspace. It rebuilds with `--locked`
# and lands the binary under $CARGO_HOME/bin (here pinned to RUNNER_TEMP
# so we can probe it without polluting the runner). Linux-only because
# CLI behavior is the same across platforms and the cargo install code
# path is what differs; the cross-OS smoke job above already covers the
# multi-platform behavior of the binary itself.
cargo-install-smoke:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Rust cache
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
workspaces: './src-tauri -> target'
prefix-key: 'v2-whisper-vs18'
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev
- name: R11 cargo install --path smoke
shell: bash
run: |
INSTALL_ROOT="$RUNNER_TEMP/aeroftp-install"
cargo install --path src-tauri --bin aeroftp-cli \
--root "$INSTALL_ROOT" --locked
BIN="$INSTALL_ROOT/bin/aeroftp-cli"
test -x "$BIN" || { echo "::error::R11 binary missing at $BIN"; exit 1; }
"$BIN" --version
"$BIN" --help > /dev/null
EXPECTED=$(grep -m1 '^version' src-tauri/Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
ACTUAL=$("$BIN" --version | awk '{print $NF}')
if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "::error::R11 installed binary version $ACTUAL != Cargo.toml $EXPECTED"
exit 1
fi
coverage:
runs-on: ubuntu-latest
needs: smoke
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Rust cache
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
workspaces: './src-tauri -> target'
# Mirror smoke job prefix to keep cache keys aligned across jobs
# in this workflow. Linux coverage does not hit the VS18 issue,
# but a shared prefix avoids partial cache reuse confusion.
prefix-key: 'v2-whisper-vs18'
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@9baf7c20ae8e70a5220bd48d08870afb205ab1ed # cargo-llvm-cov
- name: Generate coverage
working-directory: src-tauri
shell: bash
# Baseline at T8 Fase A (2026-04-21): 11.73% lines, 9.59% functions.
# Gate is set below baseline so CI passes today; raise per T8 Fase B/C/D
# as new tests land. Target after Fase C (16 zero-coverage providers): 25%.
run: |
cargo llvm-cov --no-report --all-targets
cargo llvm-cov report --lcov --output-path lcov.info
cargo llvm-cov report --summary-only --fail-under-lines 10 | tee coverage-summary.txt
- name: Upload coverage artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage-linux
path: |
src-tauri/lcov.info
src-tauri/coverage-summary.txt
- name: Upload to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
files: src-tauri/lcov.info
fail_ci_if_error: false