Skip to content

fix: course creation bug batch (#362) #25

fix: course creation bug batch (#362)

fix: course creation bug batch (#362) #25

Workflow file for this run

name: E2E Tests
env:
HUSKY: 0
JWT_SECRET: "test_secret"
JWT_REFRESH_SECRET: "test_refresh"
JWT_EXPIRATION_TIME: "15min"
CORS_ORIGIN: ""
EMAIL_ADAPTER: "mailhog"
DATABASE_URL: ""
REDIS_URL: ""
SMTP_HOST: ""
SMTP_PORT: "1025"
SMTP_USER: ""
SMTP_PASSWORD: ""
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ""
AWS_SECRET_ACCESS_KEY: ""
AWS_BUCKET_NAME: ""
SES_EMAIL: "[email protected]"
STRIPE_SECRET_KEY: "test_secret"
STRIPE_PUBLISHABLE_KEY: "test_secret"
STRIPE_WEBHOOK_SECRET: "test_secret"
on:
workflow_call:
push:
branches:
- main
- "deploy-staging/**"
workflow_dispatch:
jobs:
playwright:
name: Playwright Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_db
ports:
- 54321:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:alpine
ports:
- 6380:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium
working-directory: ./apps/web
env:
PLAYWRIGHT_BROWSERS_PATH: /home/runner/.cache/ms-playwright
# - name: Setup Caddy
# run: |
# sudo apt-get update
# sudo apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl
# curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
# curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
# sudo apt-get update
# sudo apt-get install caddy=2.8.4
# - name: Setup hosts
# run: |
# echo "127.0.0.1 app.lms.localhost" | sudo tee -a /etc/hosts
# - name: Debug Caddy
# working-directory: ./apps/reverse-proxy
# run: |
# caddy version
# caddy adapt --config Caddyfile
# caddy validate --config Caddyfile
# - name: Start Caddy
# working-directory: ./apps/reverse-proxy
# run: |
# sudo caddy run --config Caddyfile &
# - name: Ensure Caddy is running
# run: |
# pgrep -af caddy || exit 1
- name: Run tests
run: pnpm playwright test
working-directory: ./apps/web
env:
PLAYWRIGHT_BROWSERS_PATH: /home/runner/.cache/ms-playwright
DATABASE_URL: postgresql://test_user:test_password@localhost:54321/test_db
REDIS_HOST: localhost
REDIS_PORT: 6380
NODE_ENV: test