Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,41 @@ jobs:
with:
fetch-depth: 2

# 1️⃣ Upgrade to Node 22 (Required for MCP)
# 1 Upgrade to Node 22 (Required for MCP)
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

# 2️⃣ Install Dependencies (With Dummy Env)
# 2 Install Dependencies (With Dummy Env)
- name: Install Dependencies
run: npm ci
env:
DATABASE_URL: "postgresql://dummy:password@localhost:5432/mydb"
BETTER_AUTH_SECRET: "dummy_secret_for_install"

# 3️⃣ Generate Prisma Client (Direct Command)
# 3 Generate Prisma Client (Direct Command)
# ⚠️ FIX: We run prisma directly here instead of via Turbo
- name: Generate Prisma Client
run: npx prisma generate --schema=apps/api/prisma/schema.prisma
env:
DATABASE_URL: "postgresql://dummy:password@localhost:5432/mydb"

# 4️⃣ Run Turbo Pipeline (Build & Lint only)
# 4 e2e Tests
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright Tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30


# 5 Run Turbo Pipeline (Build & Lint only)
- name: Run Turbo Pipeline
# ⚠️ FIX: Pass DATABASE_URL directly in the command line
run: DATABASE_URL="postgresql://dummy:password@localhost:5432/mydb" npx turbo run build lint
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ build/

#turbo repo
.turbo

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
71 changes: 68 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@
"lint": "turbo lint",
"clean": "turbo clean",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"test:e2e": "npx playwright test",
"test:e2e:watch": "npx playwright test --watch",
"show-report:e2e": "npx playwright show-report",
"changeset": "changeset",
"version-packages": "changeset version",
"publish-packages": "changeset publish"
},
"devDependencies": {
"turbo": "^2.3.0",
"@changesets/cli": "^2.27.0",
"prettier": "^3.0.0"
}
,
"@playwright/test": "^1.58.0",
"@types/node": "^25.0.10",
"prettier": "^3.0.0",
"turbo": "^2.3.0"
},
"overrides": {
"react": "19.2.3",
"react-dom": "19.2.3"
}
}
}
94 changes: 94 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('')`. */
baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace:'on',
video: 'on',
screenshot: 'only-on-failure',
connectOptions: process.env.CI ? undefined : {
wsEndpoint: 'ws://127.0.0.1:3000/',
},
},

/* Configure projects for major browsers */
projects: [
{
name: 'API',
testDir: './tests/api',
use:{

}
},
{
name: 'web-chrome',
testDir: './tests/web',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'web-firefox',
testDir: './tests/web',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'web-webkit',
testDir: './tests/web',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
});
Loading