fix: shared 테스트 설명 문구 및 describe 그룹핑 오류 수정 #395
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| checks: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 소스코드 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: Node.js 설정 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: npm 캐시 설정 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: 의존성 설치 | |
| run: npm install --frozen-lockfile | |
| - name: 린트 | |
| run: npm run lint | |
| - name: 빌드 | |
| run: npm run build | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 소스코드 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: Node.js 설정 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: npm 캐시 설정 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: 의존성 설치 | |
| run: npm install --frozen-lockfile | |
| - name: 테스트 및 커버리지 생성 | |
| run: npm run test:coverage | |
| - name: 커버리지 리포트 PR 코멘트 | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| if: github.event_name == 'pull_request' | |
| pr-checks: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: always() && github.event_name == 'pull_request' | |
| steps: | |
| - name: PR CI 결과 코멘트 | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const buildResult = '${{ needs.build.result }}'; | |
| const message = buildResult === 'success' | |
| ? '✅ CI 성공 (빌드 & 린트 통과)' | |
| : `❌ CI 실패 (빌드: ${buildResult})`; | |
| github.rest.issues.createComment({ | |
| issue_number: context.payload.pull_request.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: message | |
| }); |