From d8254bb3ae2959349d2122d059263ad01a4b6983 Mon Sep 17 00:00:00 2001 From: Owen Rees Date: Sat, 24 Jun 2023 21:17:30 +0200 Subject: [PATCH] Update cypress.yml --- .github/workflows/cypress.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 7cfbfe1..e1a5e3f 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -13,6 +13,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + + - name: Cache npm and NextJs build + uses: actions/cache@v3 + with: + # See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + - name: Cypress run # Uses the official Cypress GitHub action https://github.com/cypress-io/github-action uses: cypress-io/github-action@v4