Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 빌드 가능 여부 테스트 #585

Merged
merged 3 commits into from
Jul 23, 2023
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
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ permissions:
contents: write
defaults:
run:
working-directory: docs
working-directory: docs

jobs:
deploy:
docs:
name: Deploy Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
clear-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
pull_request:

jobs:
test:
name: Test PR
runs-on: ubuntu-latest
environment: development

steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: setup pnpm
run: |
corepack enable
corepack prepare pnpm@latest-8 --activate
pnpm config set store-dir .pnpm-store

- name: install dependencies
working-directory: backend
run: pnpm install

- name: build backend
working-directory: backend
run: pnpm build

# TODO: 테스트 실행
2 changes: 1 addition & 1 deletion backend/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dotenv.config();
const runtimeMode = getRuntimeMode(process.env);

// graceful shutdown시 서버 종료 대기 시간
export const gracefulTerminationTimeout = runtimeMode === 'development' ? 0 : 30 * 1000;
export const gracefulTerminationTimeout = runtimeMode === 'production' ? 30 * 1000 : 0;

export const logLevelOption = getLogLevelOption(runtimeMode);
export const connectMode = getModeOption(process.env);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/config/logOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const colors: Record<LogLevel, string> = {
} as const;

export const getLogLevelOption = (mode: RuntimeMode): LogLevelOption => {
const logLevel = (mode === 'development' ? 'debug' : 'http');
const logLevel = (mode === 'production' ? 'http' : 'debug');
const consoleLogLevel = (mode === 'production' ? 'error' : 'debug');

return { logLevel, consoleLogLevel } as const;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/config/runtimeOption.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod';

export type RuntimeMode = z.infer<typeof runtimeModeSchema>;
export const runtimeModeSchema = z.enum(['development', 'production']);
export const runtimeModeSchema = z.enum(['development', 'production', 'test']);
scarf005 marked this conversation as resolved.
Show resolved Hide resolved

export const runtimeSchema = z.object({ NODE_ENV: runtimeModeSchema.default('development') });

Expand Down