Skip to content

Commit 74eab17

Browse files
authored
Feature/NS-25-add-github-actions (#62)
* feat: add chat gpt code review github action * Revert "feat: add chat gpt code review github action" This reverts commit 75d2d92. * feat: add playwright github action * refactor: fix playwright github action * Revert "refactor: fix playwright github action" This reverts commit 34c1232. * refactor: fix playwright github action * fix: fix playwright github action * fix: fix playwright config * fix: add optional to each env * refactor: final touches
1 parent d4180c1 commit 74eab17

File tree

5 files changed

+41
-19
lines changed

5 files changed

+41
-19
lines changed

.github/workflows/lint.yml

-7
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,16 @@ on:
88
jobs:
99
lint:
1010
name: Eslint, Typescript, prettier and test
11-
1211
runs-on: ubuntu-latest
13-
1412
steps:
1513
- uses: actions/checkout@v2
16-
1714
- name: Install dependencies
1815
run: npm install
19-
2016
- name: ESLint
2117
run: npm run lint
22-
2318
- name: Type check
2419
run: npm run typecheck
25-
2620
- name: Prettier
2721
run: npm run format:check
28-
2922
- name: Tests
3023
run: npm run test

.github/workflows/playwright.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
- develop
8+
pull_request: null
9+
workflow_dispatch: null
10+
11+
jobs:
12+
test:
13+
timeout-minutes: 60
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Install playwright browsers
21+
run: npx playwright install --with-deps
22+
- name: Run tests
23+
run: npm run e2e
24+
- uses: actions/upload-artifact@v3
25+
if: always()
26+
with:
27+
name: playwright-report
28+
path: playwright-report/
29+
retention-days: 30

playwright.config.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineConfig({
2525
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2626
use: {
2727
/* Base URL to use in actions like `await page.goto('/')`. */
28-
baseURL: 'http://localhost:3000',
28+
baseURL: 'http://127.0.0.1:3000',
2929
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3030
trace: 'on-first-retry',
3131
},
@@ -69,9 +69,9 @@ export default defineConfig({
6969
],
7070

7171
/* Run your local dev server before starting the tests */
72-
// webServer: {
73-
// command: 'npm run start',
74-
// url: 'http://127.0.0.1:3000',
75-
// reuseExistingServer: !process.env.CI,
76-
// },
72+
webServer: {
73+
command: 'npm run dev',
74+
url: 'http://127.0.0.1:3000',
75+
reuseExistingServer: !process.env.CI,
76+
},
7777
});

src/app/api/auth/[...nextauth]/auth-options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { env } from '@/env.mjs';
66
export const authOptions: NextAuthOptions = {
77
providers: [
88
GitHubProvider({
9-
clientId: env.NEXT_PUBLIC_GITHUB_ID,
10-
clientSecret: env.NEXT_PUBLIC_GITHUB_SECRET,
9+
clientId: env.NEXT_PUBLIC_GITHUB_ID || '',
10+
clientSecret: env.NEXT_PUBLIC_GITHUB_SECRET || '',
1111
}),
1212
],
1313
};

src/env.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { z } from 'zod';
33

44
export const env = createEnv({
55
server: {
6-
NEXT_PUBLIC_SITE_URL: z.string().url(),
7-
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION_ID: z.string().min(1),
8-
NEXT_PUBLIC_GITHUB_ID: z.string().min(1),
9-
NEXT_PUBLIC_GITHUB_SECRET: z.string().min(1),
6+
NEXT_PUBLIC_SITE_URL: z.string().url().optional(),
7+
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION_ID: z.string().min(1).optional(),
8+
NEXT_PUBLIC_GITHUB_ID: z.string().min(1).optional(),
9+
NEXT_PUBLIC_GITHUB_SECRET: z.string().min(1).optional(),
1010
},
1111
runtimeEnv: {
1212
NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL,

0 commit comments

Comments
 (0)