[FE] 테스트 자동화 yml 스크립트 및 jest ci 테스트 명령어 작성 #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |