From f37b78317bd3056137c68d117d1f630e681d73ba Mon Sep 17 00:00:00 2001 From: Ryan Bas Date: Wed, 3 Sep 2025 08:51:38 -0600 Subject: [PATCH] feat(ci): cache playwright browsers and use .node-version --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/publish.yml | 10 +++++++++- .github/workflows/snapshot.yml | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09cad301c1..672fccd257 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/setup-node@v4 id: cache with: - node-version: '22.14.0' + node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install --frozen-lockfile @@ -42,6 +42,14 @@ jobs: - run: pnpm dlx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yml" --stop-agents-after="e2e-ci" --with-env-vars="CODECOV_TOKEN" - run: pnpm nx sync:check + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright- + - run: pnpm exec playwright install - uses: nrwl/nx-set-shas@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7a65895fa0..056b88366d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-node@v4 id: cache with: - node-version: '22.14.0' + node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install --frozen-lockfile @@ -40,6 +40,14 @@ jobs: # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested - run: pnpm dlx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yml" --stop-agents-after="e2e-ci" --with-env-vars="CODECOV_TOKEN" + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright- + - run: pnpm exec playwright install - uses: nrwl/nx-set-shas@v4 diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 1f81f9929e..e1bf45cd07 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-node@v4 id: cache with: - node-version: '22.14.0' + node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install --frozen-lockfile @@ -53,6 +53,14 @@ jobs: # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested - run: pnpm dlx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yml" --stop-agents-after="e2e-ci" --with-env-vars="CODECOV_TOKEN" + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright- + - run: pnpm exec playwright install - uses: nrwl/nx-set-shas@v4