FEC - 1237 - 1246 Chromatic wrap up #16707
Workflow file for this run
This file contains hidden or 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: Main workflow | |
| # The event triggers are configured as following: | |
| # - on branch main, trigger the workflow on every push | |
| # - on any pull request, trigger the workflow | |
| # This is to avoid running the workflow twice on pull requests. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: write # Required for size-limit-action to comment on PRs | |
| jobs: | |
| build_lint_and_test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 | |
| - name: Setup Node (uses version in .nvmrc) | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Get pnpm store | |
| id: pnpm-store | |
| run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: ${{ steps.pnpm-store.outputs.dir }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml', 'patches/*.patch') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check for unmet constraints | |
| run: node scripts/check-workspace-constraints.js | |
| - name: Building packages | |
| run: pnpm build | |
| - name: Running static type checking | |
| run: pnpm typecheck | |
| # Gates phantom-dep regressions introduced by pnpm's shamefully-hoist | |
| # posture (see FEC-924 risk #4). Runs publint per published package | |
| # against the packed tarball; fails on any publint error. | |
| - name: Running publint check | |
| run: pnpm lint:publint | |
| - name: Running linters and tests | |
| run: pnpm jest --projects jest.{eslint,test,ts-test,bundle}.config.js --reporters github-actions | |
| env: | |
| CI: true | |
| - name: Building Visual Regression Tests application for UI components | |
| run: pnpm visual-testing-app:build | |
| # The visual-test browser (jest-puppeteer) and Percy's asset-discovery | |
| # browser both need a Chrome. Puppeteer's and Percy's own pinned downloads | |
| # (Chrome-for-Testing 127.0.6533.88 / Percy Chromium snapshot 1300309) stopped | |
| # working in CI and yielded 0 snapshots, so we provision Chrome explicitly | |
| # here and point both tools at it. jest-puppeteer.config.js reads | |
| # PUPPETEER_EXECUTABLE_PATH and launches with --no-sandbox. | |
| # | |
| # Pinned to 127.0.6533.88 β the Chrome build puppeteer 22.15.0 targets and | |
| # the one the Percy baseline was captured with. `chrome-version: stable` | |
| # pulled Chrome 149 (~22 majors newer), which broke 2 visual test suites | |
| # via CDP/runtime drift. Bump this in lockstep with puppeteer. | |
| - name: Set up Chrome | |
| id: setup-chrome | |
| uses: browser-actions/setup-chrome@2e1d749697dd1612b833dba4a722266286fbefcd # v2.1.2 | |
| with: | |
| chrome-version: 127.0.6533.88 | |
| - name: Running Visual Regression Tests for UI components | |
| run: | | |
| echo "Using Chrome ${{ steps.setup-chrome.outputs.chrome-version }} at $PUPPETEER_EXECUTABLE_PATH" | |
| pnpm vrt:components | |
| timeout-minutes: 20 | |
| env: | |
| PUPPETEER_EXECUTABLE_PATH: ${{ steps.setup-chrome.outputs.chrome-path }} | |
| PERCY_BROWSER_EXECUTABLE: ${{ steps.setup-chrome.outputs.chrome-path }} | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| - name: Set bundlewatch environment variables | |
| id: bundlewatch | |
| run: | | |
| echo "repo_name=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Checking bundle size | |
| run: pnpm bundlewatch | |
| env: | |
| BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} | |
| CI_REPO_OWNER: ${{ github.repository_owner }} | |
| CI_REPO_NAME: ${{ steps.bundlewatch.outputs.repo_name }} | |
| CI_COMMIT_SHA: ${{ github.sha }} | |
| CI_BRANCH: ${{ github.ref_name }} | |
| CI_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} |