Skip to content

Commit

Permalink
chore: improve playwright ci caching
Browse files Browse the repository at this point in the history
  • Loading branch information
vujita committed Jan 7, 2024
1 parent d32e4a0 commit 59a848b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
DATABASE_URL: ${{ secrets.DATABASE_PREVIEW_URL }}

jobs:
build-lint:
env:
DATABASE_URL: file:./db.sqlite
runs-on: ubuntu-latest

steps:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
DATABASE_URL: ${{ secrets.DATABASE_PREVIEW_URL }}
jobs:
test-e2e:
env:
DATABASE_URL: ${{ secrets.DATABASE_PREVIEW_URL }}
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: supersecret
DISCORD_CLIENT_ID: STUBBED_ID
Expand Down Expand Up @@ -45,9 +45,6 @@ jobs:
- name: Install deps (with cache)
run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Cache turbo build setup
uses: actions/cache@v3
with:
Expand All @@ -56,6 +53,20 @@ jobs:
restore-keys: |
${{ runner.os }}-turbo-
- name: turbo build
run: pnpm turbo run build --cache-dir=.turbo

- uses: actions/cache@v3
id: playwright-cache3
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm exec playwright install --with-deps
if: steps.playwright-cache3.outputs.cache-hit != 'true'
- run: pnpm exec playwright install-deps
if: steps.playwright-cache3.outputs.cache-hit == 'true'

- name: Run Playwright tests
run: pnpm turbo run e2e --cache-dir=.turbo

Expand Down

0 comments on commit 59a848b

Please sign in to comment.