Skip to content

Commit 586421d

Browse files
committed
ci(workflows): [ci] add pkg-size-report
- https://github.com/pkg-size/action Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 380dd8e commit 586421d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ keyid
77
lintstagedrc
88
micnncim
99
mlly
10+
nvmrc
1011
syncer
1112
vitepress
1213
vuedx
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Package Size Report
2+
#
3+
# Automate package size reports on pull request creation and synchronization.
4+
#
5+
# References:
6+
#
7+
# - https://docs.github.com/actions/learn-github-actions/contexts
8+
# - https://docs.github.com/actions/learn-github-actions/expressions
9+
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
10+
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
11+
# - https://github.com/actions/checkout
12+
# - https://github.com/actions/setup-node
13+
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration
14+
# - https://github.com/hmarr/debug-action
15+
# - https://github.com/pkg-size/action
16+
17+
---
18+
name: pkg-size-report
19+
on:
20+
pull_request:
21+
branches:
22+
- main
23+
permissions:
24+
issues: write
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref }}
27+
cancel-in-progress: true
28+
jobs:
29+
pkg-size-report:
30+
if: github.actor != 'dependabot[bot]'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- id: debug
34+
name: Print environment variables and event payload
35+
uses: hmarr/debug-action@v2.1.0
36+
- id: checkout
37+
name: Checkout ${{ github.head_ref }}
38+
uses: actions/checkout@v3.3.0
39+
with:
40+
ref: ${{ github.head_ref }}
41+
- id: node
42+
name: Setup Node.js
43+
uses: actions/setup-node@v3.6.0
44+
with:
45+
cache: yarn
46+
cache-dependency-path: yarn.lock
47+
node-version-file: .nvmrc
48+
- id: build
49+
name: Build project
50+
run: yarn build
51+
env:
52+
NODE_ENV: production
53+
- id: report
54+
name: Package size report
55+
uses: pkg-size/action@v1.1.1
56+
with:
57+
build-command: false
58+
comment-report: true
59+
display-size: uncompressed
60+
mode: regression
61+
sort-by: path
62+
sort-order: desc
63+
unchanged-files: show

0 commit comments

Comments
 (0)