test(ci): add quality gates, e2e data prep, and i18n integration coverage
This commit is contained in:
70
.gitea/workflows/ci.yml
Normal file
70
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,70 @@
|
||||
name: CMS CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- staging
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUN_VERSION: "1.3.5"
|
||||
NODE_ENV: "test"
|
||||
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/cms?schema=public"
|
||||
BETTER_AUTH_SECRET: "ci-test-secret-change-me"
|
||||
BETTER_AUTH_URL: "http://localhost:3001"
|
||||
CMS_ADMIN_ORIGIN: "http://127.0.0.1:3001"
|
||||
CMS_WEB_ORIGIN: "http://127.0.0.1:3000"
|
||||
CMS_ADMIN_SELF_REGISTRATION_ENABLED: "false"
|
||||
CMS_SUPPORT_USERNAME: "support"
|
||||
CMS_SUPPORT_EMAIL: "support@cms.local"
|
||||
CMS_SUPPORT_PASSWORD: "support-ci-password"
|
||||
CMS_SUPPORT_NAME: "Technical Support"
|
||||
CMS_SUPPORT_LOGIN_KEY: "support-access"
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
name: Lint Typecheck Unit E2E
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_DB: cms
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres -d cms"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: ${{ env.BUN_VERSION }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Install Playwright browser deps
|
||||
run: bunx playwright install --with-deps chromium
|
||||
|
||||
- name: Lint and format checks
|
||||
run: bun run check
|
||||
|
||||
- name: Typecheck
|
||||
run: bun run typecheck
|
||||
|
||||
- name: Unit and integration tests
|
||||
run: bun run test
|
||||
|
||||
- name: E2E tests
|
||||
run: bun run test:e2e
|
||||
Reference in New Issue
Block a user