diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ce48ead8..b1bdac18 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,19 +1,7 @@ name: docs on: - release: - types: [published] - workflow_dispatch: - inputs: - work: - description: 작업 트리거 - required: false - push: - branches: - - main - paths: - - "docs/**" workflow_run: - workflows: [E2E] + workflows: [pre-docs-e2e] types: [completed] env: diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index efa686f3..9a8b9a6c 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -2,9 +2,6 @@ name: npm-publish on: release: types: [published] - workflow_run: - workflows: [E2E] - types: [completed] env: CI: true @@ -12,7 +9,6 @@ env: jobs: publish: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v3 - name: Install Node.js diff --git a/.github/workflows/e2e.yaml b/.github/workflows/pr-e2e copy.yaml similarity index 86% rename from .github/workflows/e2e.yaml rename to .github/workflows/pr-e2e copy.yaml index 0705606d..5a45990a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/pr-e2e copy.yaml @@ -1,8 +1,13 @@ -name: E2E +name: pr-e2e on: pull_request: branches: [main] +env: + CI: true + KAKAOMAP_API_KEY: ${{ secrets.KAKAOMAP_API_KEY }} + VITE_KAKAOMAP_API_KEY: ${{ secrets.KAKAOMAP_API_KEY }} + jobs: test: timeout-minutes: 60 @@ -42,6 +47,6 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: playwright-report + name: pr-playwright-report path: packages/react-kakao-maps-sdk/playwright-report/ - retention-days: 30 + retention-days: 15 diff --git a/.github/workflows/pre-docs-e2e.yaml b/.github/workflows/pre-docs-e2e.yaml new file mode 100644 index 00000000..4750a9ab --- /dev/null +++ b/.github/workflows/pre-docs-e2e.yaml @@ -0,0 +1,60 @@ +name: pre-docs-e2e +on: + workflow_dispatch: + inputs: + work: + description: 작업 트리거 + required: false + push: + branches: + - main + paths: + - "docs/**" + +env: + CI: true + KAKAOMAP_API_KEY: ${{ secrets.KAKAOMAP_API_KEY }} + VITE_KAKAOMAP_API_KEY: ${{ secrets.KAKAOMAP_API_KEY }} + +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install dependencies + run: pnpm install + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Make Playwright tests snapshot + working-directory: packages/react-kakao-maps-sdk + run: | + pnpm run test -u + - name: Run Playwright tests + working-directory: packages/react-kakao-maps-sdk + run: | + pnpm run test + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: packages/react-kakao-maps-sdk/playwright-report/ + retention-days: 7