mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
Add bundlewatch to track bundle size changes in PRs (#2695)
(Below steps already performed, but kept for future reference.) Head here to get auth ID: https://service.bundlewatch.io/setup-github Create repo secret called `BUNDLEWATCH_GITHUB_TOKEN` with the token inside
This commit is contained in:
40
.github/workflows/pr_size_change.yml
vendored
Normal file
40
.github/workflows/pr_size_change.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Bundle size checker
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
push:
|
||||
paths:
|
||||
- "js/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "js/**"
|
||||
|
||||
jobs:
|
||||
bundlewatch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: Bundlewatch
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12"
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: npm ci
|
||||
working-directory: ./js
|
||||
|
||||
- name: Build production assets
|
||||
run: npm run build
|
||||
working-directory: ./js
|
||||
|
||||
- name: Check bundle size change
|
||||
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
|
||||
working-directory: ./js
|
||||
env:
|
||||
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
Reference in New Issue
Block a user