1+ name : Continuous Integration / Pull Request
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+
8+ jobs :
9+ lint :
10+ name : Lint Code
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+
17+ # -------- pnpm + cache ----------
18+ - uses : pnpm/action-setup@v4
19+ with :
20+ version : 8 # Specify pnpm version (adjust to your preferred version)
21+ - uses : actions/setup-node@v4
22+ with :
23+ node-version : 20
24+ cache : ' pnpm'
25+
26+ # Try with --frozen-lockfile first, fallback to regular install if it fails
27+ - name : Install dependencies
28+ run : pnpm install --frozen-lockfile || pnpm install
29+
30+ - name : Run ESLint
31+ run : pnpm run lint
32+
33+ build :
34+ name : Build (Node ${{ matrix.node-version }})
35+ runs-on : ubuntu-latest
36+ strategy :
37+ matrix :
38+ node-version : [18.x, 20.x, 22.x]
39+ steps :
40+ - uses : actions/checkout@v4
41+ with :
42+ fetch-depth : 0
43+
44+ # -------- pnpm + cache ----------
45+ - uses : pnpm/action-setup@v4
46+ with :
47+ version : 8 # Specify pnpm version
48+ - uses : actions/setup-node@v4
49+ with :
50+ node-version : ${{ matrix.node-version }}
51+ cache : ' pnpm'
52+
53+ # Try with --frozen-lockfile first, fallback to regular install if it fails
54+ - name : Install dependencies
55+ run : pnpm install --frozen-lockfile || pnpm install
56+
57+ - name : Build SDK
58+ run : pnpm run build
59+
60+ test :
61+ name : Run Tests
62+ runs-on : ubuntu-latest
63+ steps :
64+ - uses : actions/checkout@v4
65+ with :
66+ fetch-depth : 0
67+
68+ # -------- pnpm + cache ----------
69+ - uses : pnpm/action-setup@v4
70+ with :
71+ version : 8 # Specify pnpm version
72+ - uses : actions/setup-node@v4
73+ with :
74+ node-version : 20
75+ cache : ' pnpm'
76+
77+ # Try with --frozen-lockfile first, fallback to regular install if it fails
78+ - name : Install dependencies
79+ run : pnpm install --frozen-lockfile || pnpm install
80+
81+ - name : Run Jest tests
82+ run : pnpm run test
0 commit comments