-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
env(script): yml 파일 병렬 처리 및 test 커버리지 ai 봇 스크립트 작성 표시
- Loading branch information
Showing
3 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
name: UI Unit Test | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
@@ -18,16 +22,35 @@ jobs: | |
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
- name: Setup Yarn | ||
|
||
- name: Set up Yarn 2 (Berry) | ||
run: | | ||
corepack enable | ||
corepack prepare [email protected] --activate | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Run tests | ||
run: yarn install --immutable --inline-builds | ||
|
||
- name: Run tests with coverage | ||
run: yarn test --coverage | ||
|
||
- name: Get Coverage Info | ||
id: coverage | ||
run: | | ||
yarn add -D jest @testing-library/jest-dom @testing-library/dom @testing-library/react | ||
yarn test | ||
COVERAGE_REPORT=$(cat coverage/coverage-summary.json) | ||
echo "statements=$(echo $COVERAGE_REPORT | jq -r '.total.statements.pct')" >> $GITHUB_OUTPUT | ||
echo "branches=$(echo $COVERAGE_REPORT | jq -r '.total.branches.pct')" >> $GITHUB_OUTPUT | ||
echo "functions=$(echo $COVERAGE_REPORT | jq -r '.total.functions.pct')" >> $GITHUB_OUTPUT | ||
echo "lines=$(echo $COVERAGE_REPORT | jq -r '.total.lines.pct')" >> $GITHUB_OUTPUT | ||
- name: Comment PR with Coverage | ||
uses: thollander/actions-comment-pull-request@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
message: | | ||
## Test Coverage Report 📊 | ||
- Statements: ${{ steps.coverage.outputs.statements }}% | ||
- Branches: ${{ steps.coverage.outputs.branches }}% | ||
- Functions: ${{ steps.coverage.outputs.functions }}% | ||
- Lines: ${{ steps.coverage.outputs.lines }}% |