Skip to content

Optimize CI workflow by adding caching for node_modules and Playwri… #3

Optimize CI workflow by adding caching for node_modules and Playwri…

Optimize CI workflow by adding caching for node_modules and Playwri… #3

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Cache node_modules
id: cache-deps
uses: actions/cache@v5
with:
path: node_modules
key: deps-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install --frozen-lockfile
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Cache Playwright browsers
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
playwright-${{ runner.os }}-
- run: pnpm exec playwright install chromium --with-deps
- run: pnpm build
- run: pnpm format:check
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
- run: pnpm test:e2e
id: e2e
- uses: actions/upload-artifact@v6
if: ${{ !cancelled() && steps.e2e.outcome == 'failure' }}
with:
name: playwright-report
path: playwright-report/
retention-days: 7