From a115d2284f0824c073c188935772d26b67bfb91a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 21 Jan 2026 14:39:52 +0000 Subject: [PATCH] Rewire CI to run shared-component vitest unit tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .github/workflows/tests.yml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 80800791ff..05220c2e56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -132,27 +132,34 @@ jobs: working-directory: "packages/shared-components" run: "yarn install" - - name: Jest Cache + - name: Cache vitest uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 with: - path: /tmp/jest_cache - key: ${{ hashFiles('**/yarn.lock') }} + path: | + packages/shared-components/node_modules/.cache + packages/shared-components/node_modules/.vite/vitest + key: ${{ hashFiles('packages/shared-components/yarn.lock') }} - - name: Get number of CPU cores - id: cpu-cores - uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2 + - name: Get installed Playwright version + working-directory: packages/shared-components + id: playwright + run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT + + - name: Cache playwright binaries + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright.outputs.version }}-onlyshell + + - name: Install Playwright browsers + working-directory: packages/shared-components + if: steps.playwright-cache.outputs.cache-hit != 'true' + run: "yarn playwright install --with-deps --only-shell" - name: Run tests working-directory: "packages/shared-components" - run: | - yarn test \ - --coverage=${{ env.ENABLE_COVERAGE }} \ - --ci \ - --max-workers ${{ steps.cpu-cores.outputs.count }} \ - --cacheDirectory /tmp/jest_cache - env: - # tell jest to use coloured output - FORCE_COLOR: true + run: yarn test:unit --coverage=${{ env.ENABLE_COVERAGE }} - name: Upload Artifact if: env.ENABLE_COVERAGE == 'true'