-
Notifications
You must be signed in to change notification settings - Fork 20
110 lines (92 loc) · 3.06 KB
/
Copy pathfrontend.yml
File metadata and controls
110 lines (92 loc) · 3.06 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
name: Frontend CI
on:
push:
branches: [main]
paths:
- 'frontend/**'
- '.nvmrc'
- '.github/workflows/frontend.yml'
pull_request:
branches: [main]
paths:
- 'frontend/**'
- '.nvmrc'
- '.github/workflows/frontend.yml'
permissions:
contents: read
pull-requests: write
defaults:
run:
working-directory: frontend
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Verify npm package signatures
# --min-release-age=0 overrides the cooldown set in frontend/.npmrc.
# Signature verification is about cryptographic integrity, not version
# freshness — without the override npm refuses to resolve any package
# in the lockfile that was published more recently than the cooldown
# window (the lockfile itself is what we want to verify).
run: npm audit signatures --min-release-age=0
- name: Run Biome check
run: npm run check
- name: Run Svelte typecheck
run: npm run typecheck
build:
name: Build
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload bundle analysis
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: bundle-stats
path: frontend/dist/bundle-analyzer.html
retention-days: 7
if-no-files-found: ignore
bundle-size:
name: Bundle Size
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Report bundle size
uses: preactjs/compressed-size-action@49c7ff02f46adc39a83c24e91f6110ba8138a19d # v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pattern: "frontend/dist/**/*.{js,css,html}"
build-script: "build"
cwd: "./frontend"