sammynave e2e tests #57
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
name: E2E Tests | |
run-name: ${{github.actor}} e2e tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
Run-E2E-Tests: | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
# Set health checks to wait until postgres has started | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: startup | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 6379:6379 | |
env: | |
PUBLIC_FAKTORY_URL: http://localhost:7420 | |
FAKTORY_URL: tcp://localhost:7419 | |
FAKTORY_PASSWORD: '' | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: startup | |
DATABASE_URL: postgres://postgres:password@localhost:5432/startup | |
# why does this work instead of localhost? | |
REDIS_WS_SERVER: redis://:password@127.0.0.1:6379 | |
REDIS_WS_PASSWORD: password | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install deps | |
run: pnpm install --frozen-lockfile | |
- name: Playwright | |
run: pnpx playwright install --with-deps | |
- name: Migrate DATABASE_URL | |
run: pnpm run db:migrate | |
- name: Test | |
run: pnpm run ci:integration | |
- name: Upload results | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |