This repository was archived by the owner on Jul 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (132 loc) · 3.85 KB
/
Copy pathci.yml
File metadata and controls
160 lines (132 loc) · 3.85 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
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
desktop-checks:
name: Desktop Lint, Typecheck, Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Desktop lint
run: pnpm run lint
- name: Typecheck
run: pnpm exec tsc -b
- name: Desktop build
run: pnpm build
- name: Audit dependencies (high+)
run: |
output=$(pnpm audit --audit-level=high 2>&1) && exit 0
if echo "$output" | grep -q "ERR_PNPM_AUDIT_BAD_RESPONSE"; then
echo "::warning::npm audit endpoint unavailable, skipping"
exit 0
fi
echo "$output"
exit 1
frontend-checks:
name: Frontend Lint, Typecheck, Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Frontend lint
run: pnpm -C web run lint
- name: Frontend typecheck
run: pnpm -C web exec tsc --noEmit
- name: Frontend build
run: pnpm -C web run build
smoke-scope:
name: Smoke Scope
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.decide.outputs.should_run }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Decide smoke scope
id: decide
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha || '' }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || '' }}
run: |
if [ "$EVENT_NAME" = "push" ]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
changed_files="$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")"
echo "Changed files:"
echo "$changed_files"
if echo "$changed_files" | grep -Eq '^(src/|tests/|playwright\.smoke\.config\.ts|electron\.vite\.config\.ts|package\.json|pnpm-lock\.yaml|\.github/workflows/ci\.yml)'; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
else
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi
smoke-desktop:
name: Desktop Smoke (Electron)
if: needs.smoke-scope.outputs.should_run == 'true'
needs:
- desktop-checks
- frontend-checks
- smoke-scope
runs-on: macos-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run smoke tests
run: pnpm test:smoke
- name: Upload smoke artifacts
if: failure()
uses: actions/upload-artifact@v6
with:
name: playwright-artifacts
path: |
playwright-report
test-results
if-no-files-found: ignore