-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (84 loc) · 3.66 KB
/
ci.yaml
File metadata and controls
103 lines (84 loc) · 3.66 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
name: CI
on:
pull_request:
branches: ["**"]
push:
branches: ["main"]
merge_group:
workflow_dispatch:
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]
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.9"
- 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"
relay-runtime-smoke:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24]
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.9"
- 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