From b00f115f57156d2af7cfa2701735599d4fd312b4 Mon Sep 17 00:00:00 2001 From: JaeSeoKim <48559454+JaeSeoKim@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:33:44 +0900 Subject: [PATCH] :construction_worker: Add E2E CI --- .github/workflows/docs.yaml | 4 +++ .github/workflows/e2e.yaml | 47 ++++++++++++++++++++++++++++++ .github/workflows/npm-publish.yaml | 4 +++ 3 files changed, 55 insertions(+) create mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 6dadc960..ce48ead8 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -12,6 +12,9 @@ on: - main paths: - "docs/**" + workflow_run: + workflows: [E2E] + types: [completed] env: CI: true @@ -19,6 +22,7 @@ env: jobs: docs: 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/e2e.yaml new file mode 100644 index 00000000..0705606d --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,47 @@ +name: E2E +on: + pull_request: + branches: [main] + +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: 30 diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 9a8b9a6c..efa686f3 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -2,6 +2,9 @@ name: npm-publish on: release: types: [published] + workflow_run: + workflows: [E2E] + types: [completed] env: CI: true @@ -9,6 +12,7 @@ env: jobs: publish: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v3 - name: Install Node.js