Repository navigation
188 lines (152 loc) · 5.81 KB
/
Copy pathci.yml
File metadata and controls
188 lines (152 loc) · 5.81 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
desktop-backend:
name: Desktop backend (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@c8037a86dde8214a8310e9f54a8fc61ab362aa31 # v2
with:
workspaces: ". -> target"
# The whole Cargo workspace: the shell (app/src-tauri) and the engine
# (crates/scribe-core).
- name: Check formatting
run: cargo fmt --all --check
- name: Run clippy
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Run backend tests
run: cargo test --locked --workspace
# The test-only audio input of the end-to-end build (e2e-windows.yml).
# One command per step: a pwsh step fails only on its last command's
# exit code.
- name: Lint the e2e-audio feature
run: cargo clippy --locked --workspace --all-targets --features e2e-audio -- -D warnings
- name: Test the e2e-audio feature
run: cargo test --locked --workspace --features e2e-audio test_audio
desktop-frontend:
name: Desktop frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
cache-dependency-path: app/package-lock.json
# Same install as the release build: scripts off, esbuild's run on its own.
- name: Install dependencies
working-directory: app
run: |
npm ci --ignore-scripts
npm rebuild esbuild
# Shipped dependencies must be clean; dev-only tooling (the eslint chain)
# fails only on high or critical, since its moderate advisories often wait
# weeks for an upstream release.
- name: Audit dependencies
working-directory: app
run: |
npm audit --omit=dev
npm audit --audit-level=high
- name: Lint frontend
working-directory: app
run: npm run lint
- name: Test frontend
working-directory: app
run: npm test
- name: Build frontend
working-directory: app
run: npm run build
cli:
name: CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@c8037a86dde8214a8310e9f54a8fc61ab362aa31 # v2
with:
workspaces: cli
- name: Check formatting
working-directory: cli
run: cargo fmt --check
- name: Run clippy
working-directory: cli
run: cargo clippy --locked --all-targets -- -D warnings
- name: Run tests
working-directory: cli
run: cargo test --locked
mcp-server:
name: MCP server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
cache-dependency-path: integrations/mcp-server/package-lock.json
- name: Install dependencies
working-directory: integrations/mcp-server
run: |
npm ci --ignore-scripts
npm rebuild esbuild
# Shipped dependencies must be clean; dev-only tooling (the eslint chain)
# fails only on high or critical, since its moderate advisories often wait
# weeks for an upstream release.
- name: Audit dependencies
working-directory: integrations/mcp-server
run: |
npm audit --omit=dev
npm audit --audit-level=high
- name: Test, typecheck, and build
working-directory: integrations/mcp-server
run: npm test && npm run typecheck && npm run build
# The release workflow's SBOM steps (release.yml, build-windows), run the
# same way here so a change that empties the SBOM fails on its pull request.
release-sbom:
name: Release SBOM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Stage the SBOM source
shell: pwsh
run: ./.github/scripts/sbom-source.ps1 -Out "$env:RUNNER_TEMP/scribe"
- name: Generate source SBOM
uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
with:
path: ${{ runner.temp }}/scribe
format: cyclonedx-json
output-file: ${{ runner.temp }}/scribe.cdx.json
upload-artifact: false
upload-release-assets: false
dependency-snapshot: false
- name: Check the SBOM lists the Rust crates and npm packages
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: ./.github/scripts/check-sbom.ps1 -Sbom "$env:RUNNER_TEMP/scribe.cdx.json" -Repository "${{ github.repository }}"
rust-security:
name: Rust dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install cargo-audit
run: cargo install cargo-audit --version 0.22.2 --locked
- name: Audit Rust dependencies
run: |
cargo audit --file Cargo.lock
cargo audit --file cli/Cargo.lock