generated from worldcoin/minikit-react-template
-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (116 loc) · 3.54 KB
/
pr-check.yml
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
name: PR Check
on:
pull_request:
branches: [ main, develop ]
jobs:
quality:
name: Code Quality & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
cd frontend
pnpm install
pnpm add -D @biomejs/biome @next/bundle-analyzer
cp ../biome.json .
- name: Run Biome lint
working-directory: frontend
run: |
echo "Node version: $(node -v)"
echo "Current directory: $(pwd)"
echo "Running Biome lint..."
pnpm exec biome ci .
- name: Run Biome format check
working-directory: frontend
run: |
echo "Running Biome format check..."
pnpm exec biome check --files-ignore-unknown --no-errors-on-unmatched .
- name: Type check
working-directory: frontend
run: pnpm exec tsc --noEmit
- name: Run tests
working-directory: frontend
run: pnpm test || echo "No tests found"
- name: Build application
working-directory: frontend
run: pnpm build
security:
name: Security Scan
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Install dependencies
run: |
cd frontend
pnpm install
- name: Run security audit
working-directory: frontend
run: |
pnpm audit || echo "Security vulnerabilities found. Please review the report above."
- name: Check for outdated dependencies
working-directory: frontend
run: |
pnpm outdated || echo "Outdated dependencies found. Please review the report above."
bundle-analysis:
name: Bundle Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Install dependencies
run: |
cd frontend
pnpm install
pnpm add -D @next/bundle-analyzer
- name: Build and analyze bundle
working-directory: frontend
run: |
ANALYZE=true pnpm build || exit 1
mkdir -p .next/analyze
- name: Upload bundle analysis
if: success()
uses: actions/upload-artifact@v4
with:
name: bundle-analysis
path: frontend/.next/analyze/
compression-level: 9
retention-days: 14