Skip to content

Commit

Permalink
Fix size limit action (#3)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
peterhil authored Sep 3, 2024
1 parent 20ef56c commit 6f4a968
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,20 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v4
- name: Setup Pnpm
uses: pnpm/action-setup@v4
with:
node-version: ${{ matrix.node }}
# cache: pnpm
version: 9.4.x

- name: Cache pnpm modules
uses: actions/cache@v4
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
path: ~/.pnpm-store
key: ${{ matrix.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ matrix.os }}-
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org
cache: pnpm

- name: Pnpm install
uses: pnpm/action-setup@v4
with:
version: 9.4.x
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, typedoc, typescript]
run: pnpm install --strict-peer-dependencies

- name: Lint
run: pnpm lint
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: size
on:
pull_request:
branches:
- main
permissions:
pull-requests: write
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: pnpm

- name: Size limit
uses: andresz1/size-limit-action@v1.8.0
with:
github_token: ${{ secrets.SIZE_LIMIT_GITHUB_TOKEN }}
package_manager: pnpm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
.tap/
dist/
docs/
esbuild-why-*.html
node_modules/
types/
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
}
},
"devDependencies": {
"@size-limit/esbuild": "^11.1.4",
"@size-limit/esbuild-why": "^11.1.4",
"@size-limit/preset-small-lib": "^11.1.4",
"@types/node": "^22.5.2",
"@types/tap": "^15.0.12",
Expand Down
130 changes: 130 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f4a968

Please sign in to comment.