Inspector client, server 초기 설정 및 배포 파이프라인 추가 #1
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/CD Pipeline | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| checks: write | |
| actions: read | |
| pull-requests: write | |
| env: | |
| NODE_VERSION: "24" | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Enable Corepack (Yarn Berry) | |
| run: corepack enable | |
| - name: Setup Yarn Berry | |
| run: yarn set version 4.12.0 | |
| - name: Restore Yarn Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .yarn/cache | |
| .yarn/unplugged | |
| .yarn/build-state.yml | |
| .pnp.cjs | |
| key: yarn-${{runner.os}}-${{hashFiles('**/yarn.lock')}} | |
| restore-keys: yarn-${{runner.os}}- | |
| - name: Install Dependencies (Yarn Berry) | |
| run: yarn install --immutable | |
| - name: Restore Turborepo Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{runner.os}}-${{hashFiles('turbo.json', 'package.json', '**/package.json')}} | |
| restore-keys: turbo-${{runner.os}}- | |
| - name: Run Typecheck | |
| run: yarn typecheck | |
| - name: Run Lint | |
| run: yarn lint | |
| - name: Run Tests with Coverage | |
| run: yarn test:coverage | |
| - name: Build All Packages | |
| run: yarn build | |
| - name: Upload Inspector Client Build | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| with: | |
| name: inspector-client-dist | |
| path: packages/patchlogr-inspector/client/dist | |
| retention-days: 1 | |
| - name: Upload Inspector Server Build | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| with: | |
| name: inspector-server-dist | |
| path: packages/patchlogr-inspector/server/dist | |
| retention-days: 1 | |
| - name: Report Test Logs | |
| uses: dorny/test-reporter@v1 | |
| if: (!cancelled()) | |
| with: | |
| name: Test Logs | |
| path: "**/.coverage/report.xml" | |
| reporter: java-junit | |
| - name: Upload Test Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: (!cancelled()) | |
| with: | |
| name: Test Reports | |
| path: | | |
| **/.coverage/report.xml | |
| **/coverage/**/* | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| if: (!cancelled()) | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: packages/**/.coverage/lcov.info | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: (!cancelled()) | |
| with: | |
| files: "**/.coverage/report.xml" | |
| deploy-client: | |
| name: Deploy Inspector Client | |
| needs: build-and-test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Client Build Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: inspector-client-dist | |
| path: dist | |
| - name: Deploy to Hosting | |
| run: | | |
| echo "Client build files downloaded to ./dist" | |
| ls -la dist/ | |
| # TODO: 배포 step 추가 필요 | |
| deploy-server: | |
| name: Deploy Inspector Server | |
| needs: build-and-test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Download Server Build Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: inspector-server-dist | |
| path: packages/patchlogr-inspector/server/dist | |
| - name: Deploy to Server | |
| run: | | |
| echo "Server build files downloaded" | |
| ls -la packages/patchlogr-inspector/server/dist/ | |
| # TODO: 배포 step 추가 필요 |