Skip to content

Commit 6f4a968

Browse files
authored
Fix size limit action (#3)
* Revert "github: Delete size limit action" This reverts commit 20ef56c. * dev-deps: Add @size-limit/esbuild and @size-limit/esbuild-why * Try to fix the size limit action * Use version 1.8.0 of size-limit-action * Add package_manager: pnpm to size limit config * github: Add pnpm/action-setup step to size limit action * github: Setup Node version 20 on size limit action * github: Cache pnpm modules on size limit action * github: Try using cache option of actions/node-setup * github: Use separate steps for pnpm setup and install * github: Adjust pnpm install command arguments * github: Add eslint to global option on pnpm install * github: Remove global option from pnpm install
1 parent 20ef56c commit 6f4a968

File tree

5 files changed

+175
-17
lines changed

5 files changed

+175
-17
lines changed

.github/workflows/main.yml

+9-17
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,20 @@ jobs:
1717
- name: Checkout repo
1818
uses: actions/checkout@v4
1919

20-
- name: Use Node ${{ matrix.node }}
21-
uses: actions/setup-node@v4
20+
- name: Setup Pnpm
21+
uses: pnpm/action-setup@v4
2222
with:
23-
node-version: ${{ matrix.node }}
24-
# cache: pnpm
23+
version: 9.4.x
2524

26-
- name: Cache pnpm modules
27-
uses: actions/cache@v4
25+
- name: Setup Node ${{ matrix.node }}
26+
uses: actions/setup-node@v4
2827
with:
29-
path: ~/.pnpm-store
30-
key: ${{ matrix.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
31-
restore-keys: |
32-
${{ matrix.os }}-
28+
node-version: ${{ matrix.node }}
29+
registry-url: https://registry.npmjs.org
30+
cache: pnpm
3331

3432
- name: Pnpm install
35-
uses: pnpm/action-setup@v4
36-
with:
37-
version: 9.4.x
38-
run_install: |
39-
- recursive: true
40-
args: [--frozen-lockfile, --strict-peer-dependencies]
41-
- args: [--global, typedoc, typescript]
33+
run: pnpm install --strict-peer-dependencies
4234

4335
- name: Lint
4436
run: pnpm lint

.github/workflows/size.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: size
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
permissions:
7+
pull-requests: write
8+
jobs:
9+
size:
10+
runs-on: ubuntu-latest
11+
env:
12+
CI_JOB_NUMBER: 1
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 9.4.x
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: https://registry.npmjs.org
27+
cache: pnpm
28+
29+
- name: Size limit
30+
uses: andresz1/size-limit-action@v1.8.0
31+
with:
32+
github_token: ${{ secrets.SIZE_LIMIT_GITHUB_TOKEN }}
33+
package_manager: pnpm

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
.tap/
77
dist/
88
docs/
9+
esbuild-why-*.html
910
node_modules/
1011
types/

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
}
4040
},
4141
"devDependencies": {
42+
"@size-limit/esbuild": "^11.1.4",
43+
"@size-limit/esbuild-why": "^11.1.4",
4244
"@size-limit/preset-small-lib": "^11.1.4",
4345
"@types/node": "^22.5.2",
4446
"@types/tap": "^15.0.12",

pnpm-lock.yaml

+130
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)