Skip to content

fix : backend build 시 coverage 제거 #881

fix : backend build 시 coverage 제거

fix : backend build 시 coverage 제거 #881

Workflow file for this run

name: test
on:
push:
branches: feature/*
jobs:
common:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.16'
- name: Install yarn
run: npm i yarn -g
- name: Install dependencies
run: yarn install
- name: Test Common
run: yarn common test
backend:
runs-on: ubuntu-latest
services:
database:
image: postgres:15.3
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
# Set health checks to wait until postgres has started
options: >-
--name database
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
cache:
image: redis:7.0.12
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Increase max_connections and shared_buffers
run: |
docker exec -i database bash << EOF
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf
EOF
- name: Restart database for config
run: docker restart --time 0 database
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.16'
- name: Install yarn
run: npm i yarn -g
- name: Install dependencies
run: yarn install
- name: Transpile @my-task/common for test
run: yarn common build
- name: Test Backend
run: yarn backend test:migrate
env:
HOST: ${{ secrets.HOST }}
DB_PORT: 5432
DB_USER: ${{ secrets.POSTGRES_USER }}
DB_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
DB_DB: ${{ secrets.POSTGRES_DB }}
EMAIL_HOST: ${{secrets.EMAIL_HOST}}
EMAIL_PORT: ${{secrets.EMAIL_PORT}}
EMAIL_USER: ${{secrets.EMAIL_USER}}
EMAIL_PASS: ${{secrets.EMAIL_PASS}}
EMAIL_SENDER: ${{secrets.EMAIL_SENDER}}
EMAIL_TEST_RECEIVER: ${{secrets.EMAIL_TEST_RECEIVER}}
REDIS_PORT: 6379
REDIS_USER: default
REDIS_PASS: 'redis_pass'
BE_PORT: ${{ vars.BE_PORT }}
FE_PORT: ${{ vars.FE_PORT }}
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }}
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.16'
- name: Move GitHub Secrets to .env
run: |
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
- name: Move GitHub Variables to .env
run: |
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$VARS_CONTEXT" >> .env
env:
VARS_CONTEXT: ${{ toJson(vars) }}
- name: Install yarn
run: npm i yarn -g
- name: Install dependencies
run: yarn install
- name: Transpile @my-task/common for test
run: yarn common build
- name: Test Frontend
run: yarn frontend test