-
-
Notifications
You must be signed in to change notification settings - Fork 59
45 lines (40 loc) · 1.23 KB
/
ci-frontend-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
name: "Check and Validate CSS/JS Bundle Size with Node Setup"
on:
pull_request:
paths:
- '.github/workflows/ci-frontend-check.yml'
- 'hugo/package.json'
- 'hugo/package-lock.json'
- 'hugo/.size-limit.js'
- "hugo/**/*.jsx?"
- "hugo/**/*.tsx?"
- "hugo/**/*.scss"
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
# these steps are run in the size-limit-action anyway,
# but exposed separately so that in case there is a problem not with the file size
# but with the setup, we can see that failure clearly
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache-dependency-path: hugo
- name: Install dependencies
run: npm ci --omit=dev --omit optional
working-directory: hugo
- name: Build project
run: npm run build
working-directory: hugo
- name: Check bundle size limits
uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: hugo/
build_script: build