Skip to content

Commit

Permalink
Client-CI 구축
Browse files Browse the repository at this point in the history
Main branch 에 Push | PR시 Client  디렉토리에 있는 파일에 한해 Unit 테스트 (Jest)를 실행, 테스트 실패시 Change request를 알림
  • Loading branch information
jobkaeHenry authored Nov 3, 2023
1 parent 943ac16 commit 949a8ce
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/Client-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Client Unit test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
run_test:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Set up Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: install deps
run: npm install
working-directory: client

- name: run test
run: npm run test:ci
working-directory: client

- name: Request change
uses: actions/[email protected]
with:
github-token: ${{github.token}}
script: |
const ref = "${{github.ref}}"
const pull_number = Number(ref.split("/")[2])
await github.pulls.createReview({
...context.repo,
pull_number,
body:"[Unit test] 유닛테스트를 통과하지 못했습니다.",
event: "REQUEST_CHANGES"
})
if: failure()

0 comments on commit 949a8ce

Please sign in to comment.