From 5173b4a4dd0bf74fe5b38f50a872b5b192ad3af6 Mon Sep 17 00:00:00 2001 From: mutoe Date: Thu, 1 Dec 2022 23:12:30 +0800 Subject: [PATCH] ci: fix cypress cache issue --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30bc676..e099d6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,20 @@ jobs: - name: Install dependencies run: pnpm install + - id: cypress-version + run: pnpm info cypress version + + - name: Cache cypress binary + id: cache-cypress-binary + uses: actions/cache@v3 + with: + path: ~/.cache/Cypress + key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.stdout }} + + - name: Install cypress binary + if: steps.cache-cypress-binary.outputs.cache-hit != 'true' + run: pnpm cypress install + - name: Unit test run: pnpm test:unit:ci @@ -95,5 +109,19 @@ jobs: - name: Install dependencies run: pnpm install + - id: cypress-version + run: pnpm info cypress version + + - name: Cache cypress binary + id: cache-cypress-binary + uses: actions/cache@v3 + with: + path: ~/.cache/Cypress + key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.stdout }} + + - name: Install cypress binary + if: steps.cache-cypress-binary.outputs.cache-hit != 'true' + run: pnpm cypress install + - name: E2E test run: pnpm test:e2e:ci