인증 로직 수정 #331
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: | |
| pull_request: | |
| branches: [dev] | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: # for test | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Yarn cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .yarn/cache | |
| .yarn/unplugged | |
| .yarn/build-state.yml | |
| .yarn/install-state.gz | |
| key: yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| yarn-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Get playwright version | |
| shell: bash | |
| run: | | |
| echo "PLAYWRIGHT_VERSION=$(yarn info playwright --json | jq -r '.children.Version')" >> $GITHUB_OUTPUT | |
| id: playwright-version | |
| - name: Cache Playwright Browsers for Playwright's Version | |
| uses: actions/cache@v4 | |
| with: | |
| # https://playwright.dev/docs/browsers#managing-browser-binaries | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| id: cache-playwright-browsers | |
| - name: Setup Playwright | |
| shell: bash | |
| if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | |
| run: yarn exec playwright install --with-deps | |
| - name: Run CI | |
| run: yarn run ci | |
| - name: Build Next.js app for E2E tests | |
| env: | |
| NEXT_PUBLIC_TEST: "1" | |
| run: yarn workspace @ject-5-fe/app build | |
| - name: Cache E2E test results | |
| uses: actions/cache@v4 | |
| with: | |
| path: service/app/test-cache-map.json | |
| key: e2e-tests-${{ hashFiles('service/app/.next/app-build-manifest.json') }} | |
| restore-keys: | | |
| e2e-tests- | |
| - name: Run E2E test with cache | |
| run: yarn workspace @ject-5-fe/app run test:e2e-cached | |
| - name: build vercel preview | |
| uses: amondnet/vercel-action@v20 | |
| id: vercel-preview-deploy | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORGID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECTID }} | |
| - name: Comment on PR - Failure | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `❌ **테스트 실패** | |
| 테스트가 실패했습니다. [Actions 로그](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})를 확인해주세요.` | |
| }) |