Repository navigation
added better auth secret to address encryption failure #55
This file contains hidden or 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: ci | ||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
| jobs: | ||
| test: | ||
| timeout-minutes: 60 | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:18 | ||
| env: | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: playwright_test | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 5432:5432 | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/playwright_test | ||
| AUTH_SECRET=thisisanauthsecretfortestingonly | ||
| AUTH_URL=http://localhost:3000 | ||
| PLAYWRIGHT_TEST_BASE_URL: http://localhost:3000 | ||
| NODE_ENV: test | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/* | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Install Playwright Browsers | ||
| run: npx playwright install --with-deps | ||
| - name: Generate Prisma Client | ||
| run: npx prisma generate | ||
| - name: Run database migrations | ||
| run: npx prisma migrate deploy | ||
| - name: Seed database | ||
| run: npm run seed | ||
| - name: Verify database connection | ||
| run: npx prisma db execute --stdin <<< "SELECT COUNT(*) FROM \"User\";" | ||
| - name: Run ESLint | ||
| run: npm run lint | ||
| - name: Build Next.js application | ||
| run: npm run build | ||
| # Playwright should start the server automatically using webServer config | ||
| - name: Run Playwright tests | ||
| run: npm run playwright | ||
| - name: Upload Playwright report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() && env.ACT != 'true' | ||
| with: | ||
| name: playwright-report | ||
| path: playwright-report/ | ||
| retention-days: 30 | ||
| - name: Playwright Report Access Note | ||
| if: always() && env.ACT != 'true' | ||
| run: | | ||
| echo "::notice::To view the Playwright test report, download the 'playwright-report' artifact from the workflow run's summary page in GitHub Actions." | ||