-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (119 loc) · 4.28 KB
/
Copy pathci.yml
File metadata and controls
144 lines (119 loc) · 4.28 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
audit:
runs-on: ubuntu-22.04
name: Security Audit
steps:
- uses: actions/checkout@v4
- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: src-tauri/Cargo.toml
command: check
arguments: --all-features
check:
strategy:
fail-fast: false
matrix:
include:
- platform: windows-latest
label: Windows
- platform: macos-latest
label: macOS
- platform: ubuntu-22.04
label: Linux
runs-on: ${{ matrix.platform }}
name: ${{ matrix.label }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install Rust toolchain
run: rustup toolchain install
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install system dependencies (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: Install frontend dependencies
run: npm ci
- name: Local CI parity checks
run: npm run ci
# `npm run ci` runs `cargo test --no-default-features` (matches local pre-push).
# This job exercises the DEFAULT feature path (`plugin-shortcuts` enabled) so
# the production code path stays green and feature-gated code doesn't drift.
cargo-test-default-features:
runs-on: ubuntu-22.04
name: Rust tests (default features)
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: rustup toolchain install
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: default-features
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: cargo test (default features)
run: cargo test --manifest-path src-tauri/Cargo.toml
# Backend coverage gate. Linux-only because cargo-llvm-cov produces consistent
# numbers on a single platform. Thresholds are 90% lines / 85% functions —
# raise as coverage improves; do not lower without an ADR. Files excluded
# from the count are thin OS/IPC shims that cannot be unit-tested:
# - platform/{windows,macos,linux}.rs : OS API thin wrappers
# - services/sound.rs : rodio audio-device wrapper
# - logging.rs / main.rs : startup-only entry shims
# - commands/mod.rs : Tauri IPC command wrappers
# (#[cfg(not(test))]). Helper validate_* functions inside it ARE
# fully covered by unit tests; the file is excluded only because the
# IPC surface dominates the line count and pollutes the threshold.
cargo-coverage:
runs-on: ubuntu-22.04
name: Rust coverage (>=90% lines, >=85% functions)
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain + llvm-tools
run: |
rustup toolchain install
rustup component add llvm-tools-preview
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: coverage
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: cargo llvm-cov
run: |
cargo llvm-cov --manifest-path src-tauri/Cargo.toml \
--ignore-filename-regex 'platform/(windows|macos|linux)\.rs|services/sound\.rs|logging\.rs|main\.rs|commands/mod\.rs' \
--fail-under-lines 90 \
--fail-under-functions 85 \
--summary-only