Skip to content

Commit

Permalink
env(script): yml 파일 병렬 처리 및 test 커버리지 ai 봇 스크립트 작성 표시
Browse files Browse the repository at this point in the history
  • Loading branch information
KimKyuHoi committed Dec 6, 2024
1 parent c79bae9 commit 43a7040
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chromatic-pr.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
yarn install --immutable
yarn install --immutable --inline-builds
yarn dlx @yarnpkg/sdks vscode
- name: Build Storybook
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-push.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # 프로젝트에서 사용하는 Node.js 버전으로 설정
node-version: '18'

- name: Cache yarn dependencies
uses: actions/cache@v3
Expand All @@ -41,4 +41,4 @@ jobs:
run: yarn format --check

- name: Build the project
run: yarn build # 빌드 체크 추가
run: yarn build
37 changes: 30 additions & 7 deletions .github/workflows/unit.test.yml
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]
Expand All @@ -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 }}%

0 comments on commit 43a7040

Please sign in to comment.