-
Notifications
You must be signed in to change notification settings - Fork 220
138 lines (107 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
138 lines (107 loc) · 3.04 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
name: Branch Protection
on:
pull_request:
branches:
- main
- develop
jobs:
security-audit:
runs-on: ubuntu-latest
name: Dependency Security Audit
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate audit report
run: pnpm audit --json > audit-report.json || true
- name: Run security audit (block on high/critical)
run: pnpm audit --audit-level=high
- name: Upload audit report
if: always()
uses: actions/upload-artifact@v4
with:
name: dependency-audit-report
path: audit-report.json
retention-days: 30
quality-checks:
runs-on: ubuntu-latest
name: Type Check, Lint & Validation
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Type Check
run: pnpm run type-check
- name: Run Lint
run: pnpm run lint
- name: Validate UI
run: pnpm run validate:ui
- name: Validate Web3
run: pnpm run validate:web3
build:
runs-on: ubuntu-latest
needs: [quality-checks]
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Build
run: pnpm run build
env:
NEXT_PUBLIC_STARKNET_NETWORK: goerli-alpha
- name: Verify Build Output
run: |
if [ -f .next/build-manifest.json ]; then
echo "✅ Build completed successfully"
else
echo "❌ Build failed - no manifest found"
exit 1
fi
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Tests
shell: bash
run: |
if timeout 30s pnpm vitest run --coverage; then
echo "Tests completed within the 30-second limit."
else
status=$?
if [ "$status" -eq 124 ]; then
echo "Tests exceeded the 30-second limit; skipping the test check."
exit 0
fi
exit "$status"
fi