Add Playwright configuration and update codebase

The commit introduces Playwright configuration for End-to-End testing and modifies several files to optimize the project's structure. It also modifies the middleware to interact with Next.js and fix URL creation. Changes in database types were made to refine their structure.
This commit is contained in:
giancarlo
2024-04-11 15:59:08 +08:00
parent 2c7478abff
commit bf716b5dd6
13 changed files with 2249 additions and 1873 deletions

41
.github/workflows/workflow.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Typecheck
run: pnpm run typecheck
- name: Lint
run: pnpm run lint
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm run test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30