Update tests to use postgres #43
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"] | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: Playwright E2E tests | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
env: | |
SKIP_ENV_VALIDATION: true | |
DATABASE_URL: "mysql://user:password@localhost:34837/menufic_db" | |
NEXTAUTH_URL: "http://localhost:3000" | |
NEXTAUTH_SECRET: r+v39W_FAKE_SECRET_lc9KcXEW0= | |
IMAGEKIT_PUBLIC_KEY: ${{secrets.TEST_IMAGEKIT_PUBLIC_KEY}} | |
IMAGEKIT_PRIVATE_KEY: ${{secrets.TEST_IMAGEKIT_PRIVATE_KEY}} | |
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT: ${{secrets.TEST_NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT}} | |
IMAGEKIT_BASE_FOLDER: ${{secrets.TEST_IMAGEKIT_BASE_FOLDER}} | |
TEST_MENUFIC_USER_LOGIN_KEY: l+C9A_FAKE_LOGIN_KEY_KZK7w== | |
TEST_MENUFIC_BASE_URL: http://localhost:3000 | |
GITHUB_CLIENT_ID: ${{secrets.TEST_GITHUB_CLIENT_ID}} | |
GITHUB_CLIENT_SECRET: ${{secrets.TEST_GITHUB_CLIENT_SECRET}} | |
GOOGLE_CLIENT_ID: ${{secrets.TEST_GOOGLE_CLIENT_ID}} | |
GOOGLE_CLIENT_SECRET: ${{secrets.TEST_GOOGLE_CLIENT_SECRET}} | |
steps: | |
- uses: ikalnytskyi/action-setup-postgres@v5 | |
with: | |
username: user | |
password: password | |
database: menufic_db | |
port: 34837 | |
id: postgres | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Deploy prisma migrations | |
run: npx prisma migrate deploy | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: npx playwright test |