-
Notifications
You must be signed in to change notification settings - Fork 1
170 lines (162 loc) · 5.48 KB
/
Copy pathci.yml
File metadata and controls
170 lines (162 loc) · 5.48 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
name: CI
on:
push:
branches: [main, master]
pull_request:
permissions:
contents: read
# A newer commit makes an in-flight run for the same branch obsolete. This is
# especially valuable on the self-hosted runner, where stale builds otherwise
# sit in front of the commit a developer is actually waiting for.
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
core:
name: core (rust)
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v4
- name: install native deps (microsandbox + WebKitGTK)
run: sudo apt-get update -qq && sudo apt-get install -y libcap-ng-dev libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev pkg-config xvfb
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: core
- name: rustfmt check
working-directory: core
run: cargo fmt --all -- --check
- name: clippy
working-directory: core
run: cargo clippy --all-targets
- name: test (--locked)
working-directory: core
run: cargo test --locked
- name: release artifact smoke
working-directory: core
run: |
cargo build --release --locked
target/release/core --version
target/release/core --help | grep -q 'newline-delimited JSON'
tui:
name: tui (go)
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: tui/go.sum
- name: gofmt check
working-directory: tui
run: test -z "$(gofmt -l .)"
- name: go vet
working-directory: tui
run: go vet ./...
- name: go test
working-directory: tui
run: go test ./...
- name: go build
working-directory: tui
run: go build ./...
cross-compile:
name: tui cross-compile (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: [self-hosted, Linux, X64]
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
check_plain: false
- goos: darwin
goarch: arm64
check_plain: false
- goos: darwin
goarch: amd64
check_plain: false
- goos: windows
goarch: amd64
check_plain: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: tui/go.sum
- name: go build (plain Windows installer variant)
if: matrix.check_plain
working-directory: tui
run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -trimpath .
- name: go build -tags embed_core (staged dummy core)
working-directory: tui
# The embed_core tag embeds tui/embed/catcode-core via go:embed; stage an
# empty file so the pattern matches (compile-check only — the real core
# is injected at release time by release-*.sh). Plain builds are covered
# natively by the tui job and above for the Windows MSI variant; macOS
# releases only the embedded variant.
run: |
mkdir -p embed && touch embed/catcode-core
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -trimpath -tags embed_core .
web:
name: web (hub)
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: web
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: protocol schema consistency
run: node scripts/check-protocol-schema.mjs
- name: architecture boundary consistency
run: node scripts/check-architecture.mjs
- name: rustfmt check
working-directory: web
run: cargo fmt --all -- --check
- name: test (--locked)
working-directory: web
run: cargo test --locked
- name: build
working-directory: web
run: cargo build --locked --bins
- name: frontend rustfmt
run: cargo fmt --manifest-path web/frontend/Cargo.toml -- --check
- name: frontend unit tests
run: cargo test --manifest-path web/frontend/Cargo.toml --lib
- name: frontend wasm
run: |
rustup target add wasm32-unknown-unknown
./scripts/build-web-frontend.sh
- name: frontend e2e
working-directory: web/e2e
run: |
npm install
npx playwright install chromium
npx playwright test
- name: Restore Bun package cache
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ hashFiles('sdk/bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-bun-
- name: SDK install
working-directory: sdk
run: bun install --frozen-lockfile
- name: SDK typecheck
working-directory: sdk
run: bun run typecheck
- name: SDK protocol tests
working-directory: sdk
run: bun test