-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Playwright Tests | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
branches: ['main'] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
e2e_tests: | ||
name: 'E2E Tests' | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2 | ||
|
||
- name: Set up env | ||
run: cp .env.example .env && sed -i 's/password@db/password@localhost/' .env | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: packages-${{ hashFiles('bun.lockb') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
run: bun install --frozen-lockfile | ||
|
||
- name: Build the app | ||
run: bun run build | ||
|
||
- name: Start Services | ||
run: bun run dx:up | ||
|
||
- name: Cache playwright | ||
id: cache-playwright | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/ms-playwright | ||
${{ github.workspace }}/node_modules/playwright | ||
key: playwright-${{ hashFiles('bun.lockb') }} | ||
restore-keys: playwright- | ||
|
||
- name: Install playwright | ||
if: steps.cache-playwright.outputs.cache-hit != 'true' | ||
run: bunx playwright install --with-deps | ||
|
||
- name: Create the database | ||
run: bun run prisma:migrate-dev | ||
|
||
- name: Seed the database | ||
run: bun run prisma:seed | ||
|
||
- name: Run Playwright tests | ||
run: bun run test:e2e | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: test-results | ||
path: 'test-results/*' | ||
retention-days: 30 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters