Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Playwright to Postgres #146

Merged
merged 3 commits into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,48 +66,49 @@ jobs:
playwright:
name: ⚫️ Playwright
runs-on: ubuntu-latest
container: node:22

services:
postgres:
image: postgres
env:
POSTGRES_DB: default
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 🏄 Copy test env vars
run: cp .env.example .env

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: 📥 Download deps
run: npm ci

- name: Start a single CockroachDB instance
run: |
docker pull cockroachdb/cockroach:latest-v24.2
docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:latest-v24.2 start-single-node --insecure
sudo apt update && sudo apt install wait-for-it -y
wait-for-it -h localhost -p 26257

- name: 🛠 Setup Database
run: npx prisma db push
env:
DATABASE_URL: postgresql://root@localhost:26257/defaultdb?sslmode=disable
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/default?sslmode=disable

- name: 🌱 Seed the Database
run: npx prisma db seed
env:
DATABASE_URL: postgresql://root@localhost:26257/defaultdb?sslmode=disable
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/default?sslmode=disable

- name: ⚙️ Build
run: npm run build

- name: 🧰 Install Playwright Browsers
run: npx playwright install --with-deps

- name: 🌳 Run Playwright tests
run: npm run test:e2e:run
run: npx playwright install --with-deps && npm run test:e2e:run
env:
DATABASE_URL: postgresql://root@localhost:26257/defaultdb?sslmode=disable
HOME: /root
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/default?sslmode=disable

- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
Loading