Skip to content

Cache keys

Cache keys #140

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
test-e2e:
env:
DATABASE_URL: ${{ secrets.DATABASE_PREVIEW_URL }}
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: supersecret
DISCORD_CLIENT_ID: STUBBED_ID
DISCORD_CLIENT_SECRET: STUBBED_SECRET
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/[email protected]
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install deps (with cache)
run: pnpm install --frozen-lockfile
- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-vubnguyen-playwright
restore-keys: |
${{ runner.os }}-turbo-
- name: turbo build
run: pnpm turbo run build --cache-dir=.turbo
- uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm exec playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: pnpm exec playwright install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Run Playwright tests
run: pnpm turbo run e2e --cache-dir=.turbo
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30