forked from lidge-jun/opencodex
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (116 loc) · 3.61 KB
/
Copy pathci.yml
File metadata and controls
138 lines (116 loc) · 3.61 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
name: Cross-platform CI
on:
pull_request:
branches: [main, dev, dev2-go]
paths:
- "src/**"
- "bin/**"
- "tests/**"
- "scripts/**"
- "gui/**"
- ".gitattributes"
- ".npmignore"
- "package.json"
- "bun.lock"
- "tsconfig.json"
- ".github/workflows/ci.yml"
- ".github/workflows/release.yml"
- ".github/workflows/enforce-pr-target.yml"
- ".github/workflows/stale-needs-info.yml"
push:
branches: [main, preview, dev]
paths:
- "src/**"
- "bin/**"
- "tests/**"
- "scripts/**"
- "gui/**"
- ".gitattributes"
- ".npmignore"
- "package.json"
- "bun.lock"
- "tsconfig.json"
- ".github/workflows/ci.yml"
- ".github/workflows/release.yml"
- ".github/workflows/enforce-pr-target.yml"
- ".github/workflows/stale-needs-info.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cross-platform-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# The Windows full suite now completes near the old 8-minute ceiling; leave
# enough room for the privacy/build smokes instead of cancelling a green run.
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: |
bun install --frozen-lockfile
cd gui
bun install --frozen-lockfile
- name: Typecheck
run: bun x tsc --noEmit
- name: Test
run: bun test --isolate tests
- name: GUI tests
run: cd gui && bun test tests
- name: Privacy scan
run: bun run privacy:scan
- name: Check release helper syntax
run: bun build scripts/release.ts --target=bun --outdir=.tmp/ci-release-script-check
- name: GUI lint
run: |
cd gui
bun run lint
- name: GUI build
run: |
cd gui
bun run build
- name: CLI help smoke
run: bun run src/cli/index.ts help
npm-global-smoke:
name: npm-global ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 8
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
# Deliberately NO setup-bun: prove `npm install -g` works without a
# separately-installed Bun. The launcher uses the bundled `bun` dependency.
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20
- name: Install package dependencies
run: npm install
- name: Build package assets
run: npm run build:gui
- name: Pack
shell: bash
run: npm pack --json > pack.json
- name: Verify packed GUI asset
run: node -e "const p=require('./pack.json')[0]; if (!p.files.some(f => f.path === 'gui/dist/index.html')) { console.error('missing gui/dist/index.html in npm pack'); process.exit(1); }"
- name: Install globally (downloads bundled bun)
shell: bash
run: npm install -g ./bitkyc08-opencodex-*.tgz
- name: ocx help via bundled bun
run: ocx help