Repository navigation
120 lines (105 loc) · 4.05 KB
/
Copy pathci.yml
File metadata and controls
120 lines (105 loc) · 4.05 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
name: CI
# Run the CLAUDE.md §8 gates that don't need a human on every pull request.
# `release.yml` only fires on a `v*` tag and never runs a test, so without this
# every gate is a discipline rather than a guarantee.
#
# Design: docs/superpowers/specs/2026-07-25-ci-pr-gates-design.md
on:
pull_request:
push:
branches: [main]
# Least privilege: these jobs only ever read the checkout. Without this the token
# inherits the repository default, which can be read/write — `release.yml` scopes
# itself to `contents: write` for the same reason, since it publishes.
permissions:
contents: read
# A force-push to a PR supersedes the run already in flight — cancel it rather
# than paying for both.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend:
strategy:
# Never cancel the sibling platform: "does this break on Windows too?" is
# the one question the Windows leg exists to answer.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
# Load-bearing on Windows: this is the step that applies
# patches/@milkdown__preset-commonmark@7.21.1.patch. `.gitattributes` marks
# `patches/** -text` so Git-for-Windows' core.autocrlf can't CRLF-ify it —
# pnpm's patch parser splits on \n without stripping \r and would fail to
# apply. Nothing else verifies that.
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test
# tsc --noEmit never exercises the Vite bundle, so a broken vite.config.ts
# or a bad asset path would otherwise surface at `pnpm tauri build` — after
# a release tag is already pushed. Bundling is platform-independent.
- name: Build
if: matrix.os == 'ubuntu-latest'
run: pnpm build
crates:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: src-tauri
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: swatinem/rust-cache@v2
with:
workspaces: ./src-tauri -> target
# Named packages, NOT --workspace: that would pull in the Tauri app crate
# and with it WebKitGTK on Linux / WebView2 on Windows. These ten are
# split out (CLAUDE.md §4) precisely so their gates run without a webview.
#
# keystore's tests all run against its in-memory double. The real
# OsKeychain is deliberately untested here: Linux runners have no Secret
# Service, so it could only fail or silently skip.
#
# Windows matters here too: fsatomic is the §3.1 atomic-save gate and the
# one crate doing real filesystem syscalls, where replace-over-existing
# differs between rename(2) and MoveFileEx. fileops is the second such
# crate and needs Windows even more specifically: the names it rejects
# (reserved devices, trailing dots) and the case-only rename it must allow
# are *Windows* behaviours, and the Linux leg alone cannot see either.
- name: Test logic crates
run: >
cargo test
-p fsatomic
-p vaultscan
-p mdhtml
-p mdrtf
-p imgasset
-p trashbin
-p snapshots
-p mergemd
-p keystore
-p fileops
# `--all` covers workspace *members*, and the vendored glib is excluded
# from the workspace (§2) — so unlike clippy, this never touches upstream
# code. Clippy is deliberately left out; see the design doc §3.
- name: Check formatting
if: matrix.os == 'ubuntu-latest'
run: cargo fmt --all --check