-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 1.87 KB
/
bundle-size.yml
File metadata and controls
67 lines (59 loc) · 1.87 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
name: Bundle Size
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
bundle-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
~/.local/share/pnpm/store
~/.cache/pnpm
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Turbo Cache
uses: actions/cache@v4
with:
path: .turbo
key: turbo-${{ runner.os }}-20-${{ hashFiles('pnpm-lock.yaml', 'turbo.json', 'pnpm-workspace.yaml', 'package.json') }}
restore-keys: |
turbo-${{ runner.os }}-20-
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build packages
run: pnpm turbo run build --filter="./packages/**" --cache-dir=".turbo"
- name: Check bundle sizes
run: |
for pkg in next-compose-plugins next-transpile-modules next-cookies next-seo next-session next-iron-session next-pwa next-auth critters next-csrf; do
npx bundle-phobia-cli @opensourceframework/$pkg --limit 50 || echo "Failed to check $pkg"
done
- name: Upload bundle size report
uses: actions/upload-artifact@v4
with:
name: bundle-size-report
path: bundle-size-report.json
if-no-files-found: ignore
retention-days: 30