[pull] develop from google:develop #3194
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: Compressed Size | |
on: | |
pull_request: | |
branches: | |
- develop | |
- main | |
- 'feature/**' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
paths: | |
- '.github/workflows/compressed-size.yml' | |
- 'assets/js/**.js' | |
- '!assets/js/**.test.js' | |
- '!assets/js/**/test/**' | |
- 'assets/sass/**/*.scss' | |
- 'assets/svg/**/*.svg' | |
- './*.config.js' | |
- './package-lock.json' | |
concurrency: | |
group: compressed-size-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Check | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js (.nvmrc) | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
# nvm@7 is the minimum version required for npm workspace support. | |
# This is needed to prevent js lint failures due to module resolution to the workspace packages. | |
# This can be removed once our node base version comes with nvm@7 or greater. | |
- name: Install npm Globally | |
run: npm run install-global-npm | |
- uses: preactjs/compressed-size-action@v2 | |
with: | |
repo-token: '${{ secrets.GITHUB_TOKEN }}' | |
pattern: './dist/assets/**/*.{css,js}' | |
# The sub-match below will be replaced by asterisks. | |
# The length of 20 corresponds to webpack's `output.hashDigestLength`. | |
strip-hash: "([a-f0-9]{20})(?:\\.min)?\\.(?:css|js)$" | |
minimum-change-threshold: 1000 # 1KB |