-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.58 KB
/
Copy pathci.yml
File metadata and controls
89 lines (73 loc) · 2.58 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: |
# Clean install to avoid npm cache issues
rm -rf node_modules package-lock.json
# Install without optional dependencies to avoid rollup native binaries issue
npm install --no-optional
# Install tsup dependencies explicitly
npm install tsup esbuild --force
- name: Install scc for code analysis
run: |
# Install scc (Source Code Counter) using Go
go install github.com/boyter/scc/v3@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
export PATH="$HOME/go/bin:$PATH"
scc --version
- name: Run linting
run: npm run lint
- name: Run type check
run: npm run type-check
- name: Run tests with memory optimization
run: |
# Increase Node.js memory limit for tests
export NODE_OPTIONS="--max-old-space-size=4096"
npm run test:run
- name: Run tests with coverage
run: |
# Increase Node.js memory limit for coverage
export NODE_OPTIONS="--max-old-space-size=4096"
npm run test:coverage
- name: Build library
run: npm run build:lib
- name: Build demo (if demo files changed)
if: contains(github.event.head_commit.modified, 'demo/') || contains(github.event.head_commit.modified, 'src/') || contains(github.event.head_commit.modified, 'index.html')
run: npm run build:demo
- name: Run code analysis
run: |
export PATH="$HOME/go/bin:$PATH"
npm run analyze:json > code-analysis.json
- name: Upload code analysis results
uses: actions/upload-artifact@v4
with:
name: code-analysis
path: code-analysis.json
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
- name: Upload demo build (if built)
if: contains(github.event.head_commit.modified, 'demo/') || contains(github.event.head_commit.modified, 'src/') || contains(github.event.head_commit.modified, 'index.html')
uses: actions/upload-artifact@v4
with:
name: demo-build-${{ github.sha }}
path: dist-demo/