Challenges assignments #115
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, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
playwright-tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: "file:./prod.db" | |
NEXTAUTH_SECRET: playwright-secret | |
NEXTAUTH_URL: http://localhost:3000 | |
BASE_URL: http://localhost:3000 | |
BREVO_API_KEY: test-api-key | |
CLOUDFLARE_R2_BUCKET_NAME: test-value | |
CLOUDFLARE_R2_ACCOUNT_ID: test-value | |
CLOUDFLARE_R2_ACCESS_KEY_ID: test-value | |
CLOUDFLARE_R2_SECRET_ACCESS_KEY: test-value | |
NEXT_PUBLIC_SENTRY_ENABLED: false | |
NEXT_PUBLIC_SENTRY_DSN: test-sentry | |
SENTRY_ORGANIZATION: test-sentry | |
SENTRY_PROJECT: test-sentry | |
SENTRY_AUTH_TOKEN: test-sentry | |
EMAILS_ENABLED: false | |
NEXT_PUBLIC_DATADOG_ENABLED: false | |
NEXT_PUBLIC_DATADOG_CLIENT_TOKEN: test-datadog | |
NEXT_PUBLIC_DATADOG_SITE: test-datadog | |
NEXT_PUBLIC_LOG_DEBUG: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Prepare Database with Prisma | |
run: | | |
npm run prisma:generate | |
npm run prisma:migrate-prod | |
npm run prisma:seed | |
- name: Build the Application | |
run: npm run build | |
- name: Run Playwright tests | |
run: npm run test:e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: e2e/test-reports | |
retention-days: 30 |