refactor: wrap the bad request in invite function to make maintainable #109
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
e2e_test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: crappy_test | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run migrations | |
run: psql -f migrations/init.sql postgresql://postgres:postgres@localhost:5432/crappy_test | |
- name: Run seeds | |
run: | | |
psql -f .github/workflows/seeds/users.sql postgresql://postgres:postgres@localhost:5432/crappy_test && | |
psql -f .github/workflows/seeds/boards.sql postgresql://postgres:postgres@localhost:5432/crappy_test | |
- name: Set up Gleam, Beam | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "26.0.2" | |
gleam-version: "1.4.1" | |
rebar3-version: "3" | |
- run: gleam deps download | |
- run: gleam build | |
- name: "Start Backend" | |
env: | |
BASE_URL: http://localhost:8000 | |
SECRET_KEY_BASE: test-secret-key | |
EMAIL_API_KEY: ${{ secrets.EMAIL_API_KEY }} | |
REDIS_HOST: localhost | |
PG_USER: postgres | |
PG_PASSWORD: postgres | |
PG_HOST: localhost | |
PG_PORT: 5432 | |
PG_DB: crappy_test | |
run: | | |
gleam run & | |
sleep 30 && | |
curl http://localhost:8000 -I | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
working-directory: e2e | |
run: npm install -g yarn && yarn | |
- name: Install Playwright Browsers | |
working-directory: e2e | |
run: yarn playwright install --with-deps | |
- name: Run Playwright tests | |
working-directory: e2e | |
run: yarn start:ci | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: e2e/playwright-report/ | |
retention-days: 30 |