-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (98 loc) · 3.72 KB
/
Copy pathci.yml
File metadata and controls
113 lines (98 loc) · 3.72 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
name: CI
on:
push:
branches: [main, beta, dev]
pull_request:
branches: [main, beta]
# Cancel in-flight runs when a new commit lands on the same branch — no point
# spending CI minutes on a superseded SHA.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
BUN_VERSION: "1.3.13"
jobs:
typecheck:
name: Typecheck
runs-on: macos-14
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install
run: bun install --frozen-lockfile
- name: Build eliza submodule packages
# tsc needs the vendored eliza packages compiled to .d.ts so
# `@elizaos/core`, `@elizaos/vault`, etc. resolve from our
# tsconfig. Bun runtime doesn't need this (it loads source TS
# directly) but the typecheck step does.
run: bun run build:eliza
# tsc reports errors EVERYWHERE in the type graph (including vendored
# eliza submodules + third-party node_modules .d.ts). Filter to errors
# in our own src/ tree only. The pre-existing @elizaos/plugin-pdf
# resolution error in eliza/ is unrelated to our code.
- name: Typecheck src/
run: |
bunx tsc --noEmit -p tsconfig.json 2>&1 | tee out.log || true
if grep -E "^src/.*error TS" out.log; then
echo "::error::TypeScript errors in src/"; exit 1
fi
test:
name: Test
runs-on: macos-14
timeout-minutes: 8
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install
run: bun install --frozen-lockfile
- name: Build eliza submodule packages
# Tests import from `@elizaos/core` etc. — Bun runs source TS but the
# vendored eliza packages have generated files (i18n keyword data)
# that aren't checked in, plus their own dist/ entries some imports
# resolve through. Build them first.
run: bun run build:eliza
- name: Run unit tests
# `bun test <arg>` treats the arg as a name filter, not a path
# scope — so `bun test src/` matches every test file whose path
# contains "src/", including eliza/.../src/. Enumerate our own
# test files explicitly to keep the run scoped to flatten code.
# Plain word-splitting (no `mapfile`) — bash 3.x on the macOS
# runner doesn't have it. Filenames in src/ don't contain
# spaces, so unquoted expansion is safe.
run: |
TESTS=$(find src -name "*.test.ts" -not -path "*/node_modules/*")
if [ -z "$TESTS" ]; then echo "no tests found"; exit 1; fi
echo "running:"; echo "$TESTS"
# shellcheck disable=SC2086
bun test $TESTS
verify-assets:
name: Verify icon + asset pipeline
runs-on: macos-14
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Verify generated assets exist
run: |
set -e
test -f build-assets/tray/iconTemplate.png
test -f build-assets/tray/iconTemplate@2x.png
test -f build-assets/tray/iconTemplate@3x.png
test -f build-assets/app-icon/icon.icns
test -d build-assets/app-icon/icon.iconset
test -f build-assets/pglite/pglite.data
test -f build-assets/pglite/pglite.wasm
test -f build-assets/pglite/initdb.wasm
test -f build-assets/pglite/vector.tar.gz
test -f build-assets/pglite/fuzzystrmatch.tar.gz
echo "All assets present."