-
Notifications
You must be signed in to change notification settings - Fork 15
84 lines (72 loc) · 2.38 KB
/
Copy pathctx-desktop.yml
File metadata and controls
84 lines (72 loc) · 2.38 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
name: ctx Desktop
# Scoped to ctx-desktop/ so the heavy Tauri/Rust compile only runs when the
# desktop client actually changes — the rest of CI lives in ci.yml. Compiles
# and clippy-lints the security-critical adapter (kb_read traversal,
# flag/positional separation, child reaping) and runs the discover.rs unit
# tests, so the hardening can't silently regress.
on:
push:
branches: [main]
paths:
- 'ctx-desktop/**'
- '.github/workflows/ctx-desktop.yml'
pull_request:
branches: [main]
paths:
- 'ctx-desktop/**'
- '.github/workflows/ctx-desktop.yml'
permissions:
contents: read
jobs:
build:
name: Build + lint + test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ctx-desktop
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
# Formatting needs neither system deps nor a compile, so check it first:
# a formatting-only failure fails in seconds without paying for the apt
# install, npm ci, and the frontend/Rust builds below.
- name: Rust format check
working-directory: ctx-desktop/src-tauri
run: cargo fmt --all --check
- name: Install Tauri system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl wget file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: ctx-desktop/src-tauri
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ctx-desktop/package-lock.json
- name: Install JS dependencies
run: npm ci
# tsc && vite build — also produces ../dist, which tauri's
# generate_context! embeds at compile time (cargo steps need it).
- name: Build frontend
run: npm run build
- name: Rust clippy
working-directory: ctx-desktop/src-tauri
run: cargo clippy --all-targets -- -D warnings
- name: Rust tests
working-directory: ctx-desktop/src-tauri
run: cargo test