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

[FE] 테스트 자동화 yml 스크립트 및 jest ci 테스트 명령어 작성 #96

Merged
merged 3 commits into from
Jul 18, 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
46 changes: 46 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- 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