name: UI Lint, Unit Tests & Bundle Size # Controls when the action will run. on: # Triggers the workflow on pull request events but only for the main branch pull_request: branches: - main merge_group: types: [checks_requested] # Triggers the workflow on manual dispatch workflow_dispatch: # Cancel in-progress runs when new commits are pushed concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # Lint, restricted imports, and type checking โ€” runs once in parallel with test shards lint: runs-on: ubuntu-latest steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Enable Corepack ๐Ÿ“ฆ run: corepack enable - name: Setup โš™๏ธ Node.js ๐Ÿ”ฐ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24.x cache: 'yarn' # e2e-tests install is needed because eslint resolves eslint-plugin-cypress from e2e-tests/.eslintrc.cjs - name: Install Dependencies ๐Ÿฅ run: | yarn install --immutable cd e2e-tests yarn install --immutable cd .. - name: Lint โœ… run: yarn lint - name: Lint Restricted Imports โœ… run: yarn lint:restricted-imports - name: Type Checking run: yarn type-checks # Production bundle size budgets โ€” fails PRs that exceed per-chunk limits size-limit: runs-on: ubuntu-latest steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Enable Corepack ๐Ÿ“ฆ run: corepack enable - name: Setup โš™๏ธ Node.js ๐Ÿ”ฐ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24.x cache: 'yarn' - name: Install Dependencies ๐Ÿฅ run: yarn install --immutable - name: Build production bundle run: yarn build - name: Check bundle size budgets id: size-limit run: | set -o pipefail status=0 yarn size-limit 2>&1 | tee size-limit.log || status=$? yarn size-limit --json > size-limit.json || status=$? exit $status - name: Upload size-limit results if: failure() && steps.size-limit.outcome == 'failure' uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: size-limit-log path: | size-limit.json size-limit.log # Unit tests โ€” sharded across 2 runners for parallel execution test: runs-on: ubuntu-latest strategy: matrix: shard: [1, 2] steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Enable Corepack ๐Ÿ“ฆ run: corepack enable - name: Setup โš™๏ธ Node.js ๐Ÿ”ฐ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24.x cache: 'yarn' - name: Install Dependencies ๐Ÿฅ run: yarn install --immutable - name: Run unit tests ๐Ÿงช (shard ${{ matrix.shard }}/2) run: yarn test --maxWorkers=2 --coverage --silent --ci --verbose=false --shard=${{ matrix.shard }}/2 env: CI: true - name: Upload coverage to Codecov uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: ./coverage/lcov.info token: ${{ secrets.CODECOV_TOKEN }} flags: shard-${{ matrix.shard }} fail_ci_if_error: true