From 5a98b89e456bde3271c4b07d35eb152b50c7a481 Mon Sep 17 00:00:00 2001 From: scarf Date: Wed, 23 Aug 2023 21:32:46 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20=EA=B0=9C=EB=B0=9C=20=EC=84=9C=EB=B2=84?= =?UTF-8?q?=EB=A5=BC=20=EC=82=AC=EC=9A=A9=ED=95=B4=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 35 --------------- .github/workflows/playwright.yml | 73 +++++++++++++++++++++++--------- 2 files changed, 53 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index e4d4a427..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: 테스트 - -on: - push: - branches: - - develop - pull_request: - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Cache node modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.OS }}-master-build-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.OS }}-build- - ${{ runner.OS }}- - - - name: Install Pnpm - uses: pnpm/action-setup@v2 - with: - version: 8.x - - - name: Install Dependencies - run: pnpm install - - - name: Build - run: pnpm build diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ba8f062c..dd72dead 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,27 +1,60 @@ -name: Playwright Tests +name: 테스트 on: push: - branches: [ main, master ] + branches: [develop] pull_request: - branches: [ main, master ] + workflow_dispatch: + jobs: - test: + e2e: + environment: test timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install dependencies - run: pnpm install - - name: Install Playwright Browsers - run: pnpm exec playwright install --with-deps - - name: Run Playwright tests - run: pnpm exec playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - uses: pnpm/action-setup@v2 + name: Install pnpm + 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 --frozen-lockfile + + - name: Build app + run: pnpm run build + + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + + - name: Run Playwright tests + run: pnpm exec playwright test + env: + REACT_APP_API: ${{ secrets.REACT_APP_API }} + PORT: ${{ vars.PORT }} + REACT_APP_WISH: ${{ vars.REACT_APP_WISH }} + REACT_APP_SUGGESTION: ${{ vars.REACT_APP_SUGGESTION }} + REACT_APP_E_BOOK_LIBRARY: ${{ vars.REACT_APP_E_BOOK_LIBRARY }} + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30