diff --git a/.env.example b/.env.example index 2b725b0..80f0964 100644 --- a/.env.example +++ b/.env.example @@ -1,37 +1,29 @@ -# Since the ".env" file is gitignored, you can use the ".env.example" file to -# build a new ".env" file when you clone the repo. Keep this file up-to-date -# when you add new variables to `.env`. - -# This file will be committed to version control, so make sure not to have any -# secrets in it. If you are cloning this repo, create a copy of this file named -# ".env" and populate it with your secrets. - # When adding additional environment variables, the schema in "/src/env.js" # should be updated accordingly. -# Drizzle -# Get the Database URL from the "prisma" dropdown selector in PlanetScale. -# Change the query params at the end of the URL to "?ssl={"rejectUnauthorized":true}" -DATABASE_URL='mysql://YOUR_MYSQL_URL_HERE?ssl={"rejectUnauthorized":true}' -# DATABASE_URL='mysql://someurlYOUR_MYSQL_URL_HERE?ssl={"rejectUnauthorized":true}' +# DB-related environment variables +DATABASE_URL= # Next Auth # You can generate a new secret on the command line with: # openssl rand -base64 32 # https://next-auth.js.org/configuration/options#secret -NEXTAUTH_SECRET== +NEXTAUTH_SECRET=9df44P4igvwXwXksdJIe3jhB3dnXwJe/PZzjh2WD/6M= NEXTAUTH_URL="http://localhost:3000" -# Next Auth Discord Provider -GOOGLE_CLIENT_SECRET= -GOOGLE_CLIENT_ID= +# Google creds fot oauth2 +GOOGLE_CLIENT_SECRET=foo +GOOGLE_CLIENT_ID=foo # Telegram stuff -TELEGRAM_BOT_TOKEN= -MY_TELEGRAM_CHAT_ID= +TELEGRAM_BOT_TOKEN=foo +MY_TELEGRAM_CHAT_ID=foo + +#AWS S3 +S3_ACCESS_KEY=foo +S3_SECRET_ACCESS_KEY=foo +AWS_REGION=foo +BUCKET_NAME=foo -# S3 api stuff -S3_ACCESS_KEY= -S3_SECRET_ACCESS_KEY= -AWS_REGION= -BUCKET_NAME= +#OPENAI API KEY +OPENAI_API_KEY=foo diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 9662b54..42b17e2 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [ main, master ] + branches: [ main, dev ] pull_request: - branches: [ main, master ] + branches: [ main, dev ] jobs: test: timeout-minutes: 60 @@ -14,11 +14,13 @@ jobs: with: node-version: lts/* - name: Install dependencies - run: npm install -g pnpm && pnpm install + run: npm install -g pnpm@8.14.0 && pnpm install - name: Install Playwright Browsers run: pnpm exec playwright install --with-deps - name: Run Playwright tests run: pnpm exec playwright test + env: + PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} - uses: actions/upload-artifact@v4 if: always() with: diff --git a/playwright.config.ts b/playwright.config.ts index 301801e..804a4e1 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,16 +1,21 @@ -import { defineConfig, devices } from '@playwright/test'; - +import { defineConfig, devices } from "@playwright/test"; +import * as process from "node:process"; +import { readFileSync } from "node:fs"; /** * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config(); +// require("dotenv").config(); /** * See https://playwright.dev/docs/test-configuration. */ + +// @ts-expect-error: types suck +const env = readFileSync(".env.example", "utf8") as Record; + export default defineConfig({ - testDir: './tests', + 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. */ @@ -20,58 +25,39 @@ export default defineConfig({ /* 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', + 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://127.0.0.1:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: "on-first-retry", }, /* Configure projects for major browsers */ projects: [ { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + name: "chromium", + use: { ...devices["Desktop Chrome"] }, }, { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, + name: "firefox", + use: { ...devices["Desktop Firefox"] }, }, { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, + name: "webkit", + 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://127.0.0.1:3000', - // reuseExistingServer: !process.env.CI, - // }, + webServer: { + command: "pnpm dev", + url: "http://127.0.0.1:3000", + reuseExistingServer: !process.env.CI, + env: env, + }, });