Skip to content

Commit

Permalink
chore: 테스트 자동화 yml 스크립트 및 jest ci 테스트 명령어 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
suyoungj committed Jul 18, 2023
1 parent e87db7d commit da797a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: frontend-ci

on:
pull_request:
branches:
- develop
paths:
- frontend/**

jobs:
unit-test:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
working-directory: ./frontend

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

- name: Cache
- uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{ env.working-directory }}

- name: Run unit test
run: npm run test:ci
working-directory: ${{ env.working-directory }}
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"test": "jest --watchAll",
"test:ci": "jest --ci",
"start": "webpack serve --open",
"build": "webpack --mode production",
"storybook": "storybook dev -p 6006",
Expand Down

0 comments on commit da797a7

Please sign in to comment.