From 7d17ce2262b50f2fa429b127e7b4fd708fa32f98 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 6 Dec 2021 13:46:06 -0500 Subject: [PATCH] cache .next/cache between unit tests (#23415) Part of #1246 --- .github/workflows/test.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52fa607809a7..346b8297053b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,15 +70,20 @@ jobs: - name: Install dependencies run: npm ci - - if: ${{ github.repository == 'github/docs-internal' }} - name: Clone early access - run: npm run heroku-postbuild + - name: Clone early access + if: ${{ github.repository == 'github/docs-internal' }} + run: script/early-access/clone-for-build.js env: DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }} GIT_BRANCH: ${{ github.head_ref || github.ref }} - - if: ${{ github.repository != 'github/docs-internal' }} - name: Run build script + - name: Cache nextjs build + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 + with: + path: .next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}-${{ hashFiles('.github/workflows/test.yml') }} + + - name: Run build script run: npm run build - name: Run tests