-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (163 loc) · 6.49 KB
/
ci.yaml
File metadata and controls
199 lines (163 loc) · 6.49 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: ["main"]
merge_group:
workflow_dispatch:
inputs:
coverage_lane:
description: "Active integration coverage lane"
required: false
default: "expo"
type: choice
options:
- astro
- tanstack
- react-native
- expo
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
FORCE_COLOR: 3
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24, 25]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: "1.3.10"
- name: Install dependencies
run: bun install
- name: Install Playwright browsers
run: bun x playwright install --with-deps
- name: Verify
run: bun run verify
- name: Coverage summary
if: always()
run: |
{
echo "## Coverage Summary"
echo
if [ -f coverage/coverage-summary.json ]; then
node -e 'const fs=require("node:fs"); const total=JSON.parse(fs.readFileSync("coverage/coverage-summary.json","utf8")).total; console.log("- Vitest (v8): lines "+total.lines.pct+"% | statements "+total.statements.pct+"% | branches "+total.branches.pct+"% | functions "+total.functions.pct+"%");'
else
echo "- Vitest (v8): not available"
fi
if [ -f coverage/bun/lcov.info ]; then
node -e 'const fs=require("node:fs"); const txt=fs.readFileSync("coverage/bun/lcov.info","utf8"); let LF=0,LH=0,BRF=0,BRH=0,FNF=0,FNH=0; for (const line of txt.split(/\r?\n/)) { if (line.startsWith("LF:")) LF += Number(line.slice(3)); else if (line.startsWith("LH:")) LH += Number(line.slice(3)); else if (line.startsWith("BRF:")) BRF += Number(line.slice(4)); else if (line.startsWith("BRH:")) BRH += Number(line.slice(4)); else if (line.startsWith("FNF:")) FNF += Number(line.slice(4)); else if (line.startsWith("FNH:")) FNH += Number(line.slice(4)); } const pct=(h,f)=>f===0?"0.00":((h/f)*100).toFixed(2); console.log("- Bun test: lines "+pct(LH,LF)+"% ("+LH+"/"+LF+") | branches "+pct(BRH,BRF)+"% ("+BRH+"/"+BRF+") | functions "+pct(FNH,FNF)+"% ("+FNH+"/"+FNF+")");'
else
echo "- Bun test: not available"
fi
} >> "$GITHUB_STEP_SUMMARY"
coverage-lane:
runs-on: ubuntu-latest
env:
EVOLU_ACTIVE_COVERAGE_LANE: ${{ github.event.inputs.coverage_lane || vars.EVOLU_ACTIVE_COVERAGE_LANE || 'expo' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 24
- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: "1.3.10"
- name: Install dependencies
run: bun install
- name: Build workspace packages
run: bun run build
- name: Run active coverage lane
run: bun run coverage:lane:active
relay-runtime-smoke:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24, 25]
runtime: [bun, node]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: "1.3.10"
- name: Install dependencies
run: bun install
- name: Relay smoke tests (Bun runtime)
if: matrix.runtime == 'bun'
run: >
bunx vitest run --project unit
packages/common/test/WebSocket.test.ts
packages/common/test/local-first/Relay.test.ts
- name: Relay smoke tests (Node runtime)
if: matrix.runtime == 'node'
run: >
node ./node_modules/vitest/vitest.mjs run --project unit
packages/common/test/WebSocket.test.ts
packages/common/test/local-first/Relay.test.ts
expo-smoke:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: "1.3.10"
- name: Install dependencies
run: bun install
- name: Build workspace packages
run: bun run build
- name: Expo doctor
working-directory: examples/react-expo
continue-on-error: true
run: bunx expo-doctor
- name: Expo web export smoke
working-directory: examples/react-expo
run: bun run web:export
integrations-smoke:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24, 25]
example: [astro, tanstack-start, tauri]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: "1.3.10"
- name: Install dependencies
run: bun install
- name: Build integration package
run: bunx turbo --filter @evolu/${{ matrix.example }} build
- name: Build integration example
run: bunx turbo --filter @example/${{ matrix.example }} build