-
Notifications
You must be signed in to change notification settings - Fork 361
52 lines (47 loc) · 1.55 KB
/
Copy pathcompressed-size.yml
File metadata and controls
52 lines (47 loc) · 1.55 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
name: Compressed Size
on:
pull_request:
branches:
- develop
- main
- 'feature/**'
types:
- opened
- reopened
- synchronize
paths:
- '.github/workflows/compressed-size.yml'
- 'assets/**/*.js'
- '!assets/**/*.test.js'
- '!assets/**/test/**'
- 'assets/**/*.scss'
- 'assets/svg/**/*.svg'
- '**/*.config.js'
- 'package-lock.json'
concurrency:
group: compressed-size-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Check
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.event.pull_request.draft == false
permissions:
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # ratchet:preactjs/compressed-size-action@v2
with:
install-script: npm ci --workspace=assets --include-workspace-root
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: './dist/assets/**/*.{css,js}'
# The sub-match below will be replaced by asterisks.
# The length of 20 corresponds to webpack's `output.hashDigestLength`.
strip-hash: "([a-f0-9]{20})(?:\\.min)?\\.(?:css|js)$"
minimum-change-threshold: 1000 # 1KB