forked from Ogstevyn/payeasy
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 2.13 KB
/
bundle-size.yml
File metadata and controls
77 lines (62 loc) · 2.13 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
name: Bundle Size Check
on:
pull_request:
branches: [main, develop]
jobs:
bundle-size:
name: Check Bundle Size
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check if apps/web exists
id: web-exists
run: |
if [ -f ./apps/web/package.json ]; then
echo "::set-output name=exists::true"
else
echo "::set-output name=exists::false"
fi
- name: Setup Node.js
if: steps.web-exists.outputs.exists == 'true'
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
cache-dependency-path: ./package-lock.json
- name: Clean caches
if: steps.web-exists.outputs.exists == 'true'
run: |
cd apps/web
rm -rf node_modules/.cache
rm -rf /home/runner/.cache/next-swc
- name: Install dependencies
if: steps.web-exists.outputs.exists == 'true'
run: |
cd apps/web
npm ci
- name: Build application
if: steps.web-exists.outputs.exists == 'true'
run: |
cd apps/web
npm run build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN }}
- name: Check bundle size budgets
if: steps.web-exists.outputs.exists == 'true'
run: |
cd apps/web
npm run bundle:check
- name: Upload bundle report
if: steps.web-exists.outputs.exists == 'true' && always()
uses: actions/upload-artifact@v4
with:
name: bundle-report
path: apps/web/.next/bundle-report.json
retention-days: 30
- name: Skip bundle size check (no web app)
if: steps.web-exists.outputs.exists == 'false'
run: echo "No ./apps/web/package.json found, skipping bundle size check."