Rails 7.2 #207
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ESBuild Bundle Analyzer | |
on: | |
push: | |
branches: [main] | |
pull_request_target: | |
jobs: | |
# PLEASE AVOID ADDING OTHER JOBS IN THIS FILE | |
# BECAUSE THIS ACTION USE `pull_request_target` EVENT that grants write | |
# permissions to GitHub Actions running on PRs from forks. | |
analyze: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: read # for checkout repository | |
actions: read # for fetching base branch bundle stats | |
pull-requests: write # for comments | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# This is required to fetch the commit SHA of the forked PR | |
ref: "${{ github.event.pull_request.merge_commit_sha }}" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn workspaces focus --all --production | |
- name: Run esbuld | |
run: yarn run build:metafile | |
# Call this action after the build | |
- name: Analyze esbuild bundle size | |
# uses: exoego/esbuild-bundle-analyzer@main # If you prefer nightly! | |
uses: exoego/esbuild-bundle-analyzer@v1 | |
with: | |
metafiles: "meta.json" |