-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (146 loc) Β· 4.76 KB
/
ci.yml
File metadata and controls
179 lines (146 loc) Β· 4.76 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
name: π TypeScript SDK CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
quality:
name: π Code Quality
runs-on: ubuntu-latest
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: π¦ Install dependencies
run: npm ci
- name: π¨ Check Formatting
run: |
echo "::group::π¨ Prettier Formatting"
npm run format:check
echo "::endgroup::"
- name: π Run Linting
run: |
echo "::group::π ESLint Linting"
npm run lint
echo "::endgroup::"
- name: π¬ Type Checking
run: |
echo "::group::π¬ TypeScript Type Checking"
npx tsc --noEmit
echo "::endgroup::"
- name: β
Quality Summary
if: success()
run: |
echo "::notice::β
All code quality checks passed!"
echo "- Formatting: PASSED"
echo "- Linting: PASSED"
echo "- Type checking: PASSED"
test:
name: π§ͺ Test Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['18.20.5', '20.18.1', '22.12.0']
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π§ Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: π¦ Install dependencies
run: npm ci
- name: ποΈ Build package
run: npm run build
- name: π§ͺ Run Core Tests
run: |
echo "::group::π§ͺ Core Tests"
npm run test:core -- --run
echo "::endgroup::"
- name: π Run Performance Tests
continue-on-error: true
run: |
echo "::group::π Performance Tests"
npm run test:perf -- --run
echo "::endgroup::"
- name: π Generate Coverage Report
if: matrix.node-version == '20.18.1'
run: npm run test:coverage -- --run
- name: π Upload Coverage
if: matrix.node-version == '20.18.1'
uses: codecov/codecov-action@v4
with:
files: ./coverage/coverage-final.json
flags: unittests
name: typescript-sdk
fail_ci_if_error: false
build:
name: ποΈ Build & Package
runs-on: ubuntu-latest
needs: [quality, test]
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: π¦ Install dependencies
run: npm ci
- name: ποΈ Build package
run: npm run build
- name: π¦ Check package
run: |
npm pack --dry-run
echo "β
Package is ready for publishing"
- name: π€ Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
cross-platform:
name: π₯οΈ Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
node-version: ['20.18.1']
steps:
- name: π₯ Checkout code
uses: actions/checkout@v4
- name: π§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: π¦ Install dependencies
run: npm ci
- name: ποΈ Build package
run: npm run build
- name: π§ͺ Run Core Tests
run: npm run test:core -- --run
summary:
name: π CI Summary
runs-on: ubuntu-latest
needs: [quality, test, build, cross-platform]
if: always()
steps:
- name: π Summary
run: |
echo "## π CI Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| π Code Quality | ${{ needs.quality.result == 'success' && 'β
Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| π§ͺ Tests | ${{ needs.test.result == 'success' && 'β
Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| ποΈ Build | ${{ needs.build.result == 'success' && 'β
Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| π₯οΈ Cross-Platform | ${{ needs.cross-platform.result == 'success' && 'β
Passed' || 'β Failed' }} |" >> $GITHUB_STEP_SUMMARY