mirror of
https://github.com/mastodon/mastodon.git
synced 2026-03-24 11:30:02 -05:00
74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
name: Compare JS bundle size
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'app/javascript/**'
|
|
- 'vite.config.mts'
|
|
- 'package.json'
|
|
- 'yarn.lock'
|
|
- .github/workflows/bundlesize-compare.yml
|
|
|
|
jobs:
|
|
build-head:
|
|
name: 'Build head'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
ANALYZE_BUNDLE_SIZE: '1'
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Set up Javascript environment
|
|
uses: ./.github/actions/setup-javascript
|
|
|
|
- name: Build
|
|
run: yarn run build:production
|
|
|
|
- name: Upload stats.json
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
with:
|
|
name: head-stats
|
|
path: ./stats.json
|
|
if-no-files-found: error
|
|
|
|
build-base:
|
|
name: 'Build base'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
ANALYZE_BUNDLE_SIZE: '1'
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
ref: ${{ github.base_ref }}
|
|
|
|
- name: Set up Javascript environment
|
|
uses: ./.github/actions/setup-javascript
|
|
|
|
- name: Build
|
|
run: yarn run build:production
|
|
|
|
- name: Upload stats.json
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
with:
|
|
name: base-stats
|
|
path: ./stats.json
|
|
if-no-files-found: error
|
|
|
|
compare:
|
|
name: 'Compare base & head bundle sizes'
|
|
runs-on: ubuntu-latest
|
|
needs: [build-base, build-head]
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
|
|
|
- uses: twk3/rollup-size-compare-action@a1f8628fee0e40899ab2b46c1b6e14552b99281e # v1.2.0
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
current-stats-json-path: ./head-stats/stats.json
|
|
base-stats-json-path: ./base-stats/stats.json
|