Skip to content

Commit ef18596

Browse files
committed
fix(ci): lint-test 与 app-rust 改用 windows-latest(项目含 Windows 专用模块)
1 parent 7c5f107 commit ef18596

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

‎.github/workflows/pr-check.yml‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,16 @@ jobs:
7171
app-rust:
7272
needs: changes
7373
if: needs.changes.outputs.app-rust == 'true'
74-
runs-on: ubuntu-latest
74+
# 项目含 Windows 专用模块(audio_route_probe/device_probe/gdi_capture 等未做 Linux cfg 隔离),
75+
# 测试必须在 Windows runner 执行;Linux 编译会因 E0433 失败
76+
runs-on: windows-latest
7577
timeout-minutes: 60
7678
steps:
7779
- uses: actions/checkout@v4
7880
- uses: dtolnay/rust-toolchain@stable
7981
with:
8082
components: clippy
81-
# Tauri 在 Linux 上编译需要 glib/gtk/webkit 系统库(glib-sys 等 -sys crate 的 pkg-config 依赖)
82-
- name: Install Linux system dependencies
83-
run: |
84-
sudo apt-get update
85-
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file \
86-
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
83+
targets: x86_64-pc-windows-msvc
8784
# sherpa-onnx 等 crate 编译耗时较长,启用 sccache 加速重复构建
8885
- name: Cache cargo registry
8986
uses: Swatinem/rust-cache@v2
@@ -94,8 +91,20 @@ jobs:
9491
shell: bash
9592
run: mkdir -p app/src-tauri/models
9693
- name: Test
94+
# 覆盖 .cargo/config.toml 的本地 Windows 预编译库路径:CI runner 无 D:/ 本机目录,
95+
# 清空后 sherpa-onnx-sys/ort-sys 回退在线下载(CI 网络可达)
96+
env:
97+
SHERPA_ONNX_ARCHIVE_DIR: ""
98+
ORT_LIB_LOCATION: ""
99+
ORT_SKIP_DOWNLOAD: "0"
100+
ORT_PREFER_DYNAMIC_LINK: "1"
97101
run: cd app/src-tauri && cargo test
98102
- name: Lint (clippy)
103+
env:
104+
SHERPA_ONNX_ARCHIVE_DIR: ""
105+
ORT_LIB_LOCATION: ""
106+
ORT_SKIP_DOWNLOAD: "0"
107+
ORT_PREFER_DYNAMIC_LINK: "1"
99108
run: cd app/src-tauri && cargo clippy -- -D warnings
100109

101110
# ===========================================================================

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ concurrency:
2020

2121
jobs:
2222
lint-test:
23-
runs-on: ubuntu-latest
23+
# 项目含 Windows 专用模块(audio_route_probe/device_probe/gdi_capture 等未做 Linux cfg 隔离),
24+
# 测试必须在 Windows runner 执行;Linux 编译会因 E0433 失败
25+
runs-on: windows-latest
2426
timeout-minutes: 60
2527
steps:
2628
- uses: actions/checkout@v4
2729
- uses: dtolnay/rust-toolchain@stable
28-
# Tauri 在 Linux 上编译需要 glib/gtk/webkit 系统库(glib-sys 等 -sys crate 的 pkg-config 依赖)
29-
- name: Install Linux system dependencies
30-
run: |
31-
sudo apt-get update
32-
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file \
33-
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
30+
with:
31+
targets: x86_64-pc-windows-msvc
3432
- name: Cache cargo registry
3533
uses: Swatinem/rust-cache@v2
3634
with:
@@ -40,6 +38,13 @@ jobs:
4038
shell: bash
4139
run: mkdir -p app/src-tauri/models
4240
- name: Test
41+
# 覆盖 .cargo/config.toml 的本地 Windows 预编译库路径:CI runner 无 D:/ 本机目录,
42+
# 清空后 sherpa-onnx-sys/ort-sys 回退在线下载(CI 网络可达)
43+
env:
44+
SHERPA_ONNX_ARCHIVE_DIR: ""
45+
ORT_LIB_LOCATION: ""
46+
ORT_SKIP_DOWNLOAD: "0"
47+
ORT_PREFER_DYNAMIC_LINK: "1"
4348
run: cd app/src-tauri && cargo test
4449

4550
build:

0 commit comments

Comments
 (0)