Skip to content
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DATABASE_URL="postgres://db-user:1234@postgres:5432/test?schema=public"
EMAIL_FROM="noreply@example.com"
SMTP_SERVER_ADDRESS="mail.example.com"
SMTP_SERVER_PORT="465"
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container: node:20-bookworm

services:
postgres:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_USER: db-user
POSTGRES_PASSWORD: 1234
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4
Expand All @@ -19,11 +33,24 @@ jobs:
- name: Add config
run: cp ".github/workflows/example.env" .env

- name: Generate artifacts
run: npx prisma generate

- name: Run migrations
run: npx prisma migrate deploy

- name: Unit tests
run: npm run test:unit

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

- name: Integrations tests
run: npm run test:integration

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30