Skip to content

Commit

Permalink
Merge pull request #25 from avevotsira/check-size-ci
Browse files Browse the repository at this point in the history
chore: check size ci
  • Loading branch information
avevotsira authored Jul 30, 2024
2 parents d38af17 + 07a5ce5 commit 3b24737
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Size Limit CI

on:
pull_request:
branches: [main]

permissions:
contents: read
pull-requests: write

jobs:
size-check:
name: Check bundle size
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3

- name: Install dependencies
run: npm ci

- name: Run size-limit check
uses: andresz1/size-limit-action@v1.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: check:build
package_manager: npm

132 changes: 132 additions & 0 deletions package-lock.json

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

29 changes: 26 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"check:build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"size": "size-limit"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
Expand All @@ -22,10 +24,31 @@
"clsx": "^2.1.1",
"lucide-react": "^0.394.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5"
}
},
"devDependencies": {
"@size-limit/file": "^11.1.4",
"size-limit": "^11.1.4"
},
"size-limit": [
{
"path": "dist/**/*.html",
"limit": "50 kB",
"gzip": true
},
{
"path": "dist/**/*.css",
"limit": "20 kB",
"gzip": true
},
{
"path": "dist/**/*.js",
"limit": "100 kB",
"gzip": true
}
]
}

0 comments on commit 3b24737

Please sign in to comment.