Size check #66
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: Size check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * 5' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache for yarn | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: node-cache-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
node-cache-${{ runner.os }}-yarn- | |
- name: Cache nx cache | |
uses: actions/cache@v4 | |
with: | |
save-always: true | |
path: .cache | |
key: ${{ runner.os }}-nx-${{ hashFiles('yarn.lock', 'package.json', 'shared/common-bricks/common-bricks.json') }}-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-nx-${{ hashFiles('yarn.lock', 'package.json', 'shared/common-bricks/common-bricks.json') }}- | |
- name: Cache for cypress | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-cypress-${{ steps.cypress-version.outputs.ver }} | |
# Fix `yarn install --frozen-lockfile` not working in monorepo. | |
# https://github.com/yarnpkg/yarn/issues/5840#issuecomment-468782288 | |
- name: Get checksum before yarn install | |
id: yarn-lock-check-before | |
run: echo "::set-output name=sum::$(cksum yarn.lock)" | |
- run: yarn install --frozen-lockfile | |
env: | |
CYPRESS_INSTALL_BINARY: '' | |
- name: Get checksum after yarn install | |
id: yarn-lock-check-after | |
run: echo "::set-output name=sum::$(cksum yarn.lock)" | |
- name: Exit if yarn.lock updated | |
run: exit 1 | |
if: steps.yarn-lock-check-before.outputs.sum != steps.yarn-lock-check-after.outputs.sum | |
- run: cp size-check.config.mjs dev.config.mjs | |
- run: yarn build | |
env: | |
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0' | |
- run: yarn size-check:ci | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
continue-on-error: true | |
- run: cat size-check.log.yml | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: size-check | |
path: size-check.log.yml |