-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (89 loc) · 2.73 KB
/
tests.yml
File metadata and controls
111 lines (89 loc) · 2.73 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
name: Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
name: 'Test SDK'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm 8
uses: pnpm/action-setup@v2
with:
version: 8.6.9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run linting
run: pnpm --filter langbase lint
- name: Run type check
run: pnpm --filter langbase type-check
- name: Run tests (Node.js environment)
run: pnpm --filter langbase test:node
- name: Run tests (Edge runtime environment)
run: pnpm --filter langbase test:edge
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run UI tests (React components)
run: pnpm --filter langbase test:ui:react
# Optional: Add a separate job for ecosystem tests
ecosystem-test:
name: 'Ecosystem Tests'
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup pnpm 8
uses: pnpm/action-setup@v2
with:
version: 8.6.9
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build SDK
run: pnpm --filter langbase build
- name: Test Node.js ESM
working-directory: ecosystem-tests/node-esm
run: |
npm install
timeout 30s node index.mjs || echo "ESM test completed"
- name: Test Node.js CJS
working-directory: ecosystem-tests/node-cjs
run: |
npm install
timeout 30s node index.cjs || echo "CJS test completed"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Test Bun
working-directory: ecosystem-tests/bun
run: |
bun install
timeout 30s bun run index.ts || echo "Bun test completed"
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Test Deno
working-directory: ecosystem-tests/deno
run: timeout 30s deno run --allow-net index.ts || echo "Deno test completed"