diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d51ccbb6..e3fcc5934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,14 @@ jobs: node-version: '20.x' cache: 'pnpm' + - name: Turbo Cache + uses: actions/cache@v5 + with: + path: node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + - name: Install dependencies run: pnpm install --frozen-lockfile @@ -120,6 +128,14 @@ jobs: node-version: '20.x' cache: 'pnpm' + - name: Turbo Cache + uses: actions/cache@v5 + with: + path: node_modules/.cache/turbo + key: turbo-${{ runner.os }}-${{ github.sha }} + restore-keys: | + turbo-${{ runner.os }}- + - name: Install dependencies run: pnpm install --frozen-lockfile @@ -128,9 +144,25 @@ jobs: with: name: build-output + - name: Get Playwright version + id: playwright-version + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT + + - name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + - name: Install Playwright browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: pnpm exec playwright install --with-deps chromium + - name: Install Playwright system dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: pnpm exec playwright install-deps chromium + - name: Run E2E tests run: pnpm test:e2e --project=chromium diff --git a/.github/workflows/storybook-tests.yml b/.github/workflows/storybook-tests.yml index 25109a2c5..9a00caf20 100644 --- a/.github/workflows/storybook-tests.yml +++ b/.github/workflows/storybook-tests.yml @@ -58,9 +58,25 @@ jobs: - name: Build Storybook run: pnpm storybook:build + - name: Get Playwright version + id: playwright-version + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT + + - name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: pnpm exec playwright install --with-deps chromium + - name: Install Playwright system dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: pnpm exec playwright install-deps chromium + - name: Run Storybook tests run: pnpm storybook:ci