Repository navigation
184 lines (173 loc) · 6.32 KB
/
Copy pathci.yml
File metadata and controls
184 lines (173 loc) · 6.32 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
name: CI
on:
push:
branches: [dev, main]
pull_request:
branches: [dev, main]
# Lets a maintainer run the macOS job by hand while the repo is private.
workflow_dispatch:
# Nothing by default; each job asks for what it needs.
permissions: {}
# A new push to the same branch or pull request cancels the run it replaces.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend:
name: Frontend (lint, types, test)
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
website:
name: Website (types, test, build)
runs-on: ubuntu-24.04
permissions:
contents: read
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm check
rust:
name: Rust (fmt, clippy, test)
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Tauri system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
# The runner's own rustup: a third-party action pinned to a moving
# branch fails zizmor whenever that branch moves.
- run: |
rustup toolchain install stable --profile minimal --component rustfmt --component clippy
rustup default stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
# The Tauri app's build script requires the PTY sidecar staged under
# src-tauri/binaries; build it for the host triple before clippy/test.
- run: node scripts/sidecar-ptyd.mjs
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test
# The app is Mac-first, so the Mac is where clippy, the tests and a real
# app build have to pass. macOS runners cost ten times as much on a private
# repo, so until the repo is public this runs only when started by hand.
macos:
name: macOS (clippy, test, app build)
if: ${{ !github.event.repository.private || github.event_name == 'workflow_dispatch' }}
runs-on: macos-15
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: pnpm
- run: |
rustup toolchain install stable --profile minimal --component clippy
rustup default stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- run: pnpm install --frozen-lockfile
- run: node scripts/sidecar-ptyd.mjs
- run: cargo clippy --all-targets -- -D warnings
# Single-threaded, as `pnpm rust:test` runs them: one test changes an
# environment variable that would break git tests running beside it.
- run: cargo test -- --test-threads=1
- run: pnpm tauri build --debug --bundles app --no-sign
dependencies:
name: Rust dependencies (cargo-deny)
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
with:
command: check
workflows:
name: Workflow files (zizmor)
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Findings fail the job here instead of going to code scanning, which a
# private repo on the free plan doesn't have.
- uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
with:
advanced-security: false
hook-tests:
name: Hook tests
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# The release script's tests run git-cliff from node_modules.
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test:node
build-smoke:
name: Core build smoke
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: |
rustup toolchain install stable --profile minimal
rustup default stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- run: cargo build --release -p kriyon-core