Skip to content

Commit

Permalink
chore: fix playwright binary cache (#118)
Browse files Browse the repository at this point in the history
Any questions should be directed to @vujita

---

Replace any ":question:" below with information about your pull request.

## Pull Request Details

Provide details about your pull request and what it adds, fixes, or
changes.

:question:

## Breaking Changes

Describe what features are broken by this pull request and why, if any.

:question:

## Issues Fixed

Enter the issue numbers resolved by this pull request below, if any.

1. :question:

## Other Relevant Information

Provide any other important details below.

:question:

Signed-off-by: Vu Nguyen <[email protected]>
  • Loading branch information
vujita authored Jan 7, 2024
1 parent d32e4a0 commit eaa8ade
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 3 additions & 4 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 Expand Up @@ -43,13 +42,13 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install deps (with cache)
run: pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turbo-${{ github.sha }}-ci
restore-keys: |
${{ runner.os }}-turbo-
Expand Down
21 changes: 16 additions & 5 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,17 +45,28 @@ 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:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turbo-${{ github.sha }}-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

Expand Down

0 comments on commit eaa8ade

Please sign in to comment.