From f2c01e803b5d626c6b7ab3075c39ffa0d04e0e05 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Wed, 25 Sep 2024 14:11:45 +0100 Subject: [PATCH] ci: update cache action for better perf --- .github/workflows-src/test.ts | 4 ++-- .github/workflows-src/website.ts | 2 +- .github/workflows/test.yml | 14 +++++++------- .github/workflows/website.yml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows-src/test.ts b/.github/workflows-src/test.ts index 6faec1d3..ec216866 100644 --- a/.github/workflows-src/test.ts +++ b/.github/workflows-src/test.ts @@ -19,7 +19,7 @@ export function yarnInstallWithCache(nodeVersion: Expression): Steps { `Get yarn cache directory path`, `echo "::set-output name=dir::$(yarn cache dir)"`, ); - use('Enable Cache', 'actions/cache@v2', { + use('Enable Cache', 'actions/cache@v4', { with: { path: [ interpolate`${yarnCacheDir}`, @@ -63,7 +63,7 @@ export function buildCache(): Steps { } }) .sort(); - use(`Enable Cache`, 'actions/cache@v2', { + use(`Enable Cache`, 'actions/cache@v4', { with: { path: [ ...packageNames.map((packageName) => `packages/${packageName}/lib`), diff --git a/.github/workflows-src/website.ts b/.github/workflows-src/website.ts index 36cc8319..94670386 100644 --- a/.github/workflows-src/website.ts +++ b/.github/workflows-src/website.ts @@ -21,7 +21,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => { run('yarn build'); - use('Enable NextJS Cache', 'actions/cache@v2', { + use('Enable NextJS Cache', 'actions/cache@v4', { with: { path: ['packages/website/.next/cache'].join('\n'), key: interpolate`next-${hashFiles('yarn.lock')}`, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb6b405d..452b9bf5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -33,7 +33,7 @@ jobs: key: ${{ runner.os }}-20.x-${{ hashFiles('yarn.lock') }}-2 - run: yarn install --prefer-offline - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- packages/bigquery/lib @@ -177,7 +177,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -216,7 +216,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -257,7 +257,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -285,7 +285,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -308,7 +308,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index e7ddf330..21d899cc 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -24,7 +24,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" id: step_3 - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- ${{ steps.step_3.outputs.dir }} @@ -33,7 +33,7 @@ jobs: key: ${{ runner.os }}-20.x-${{ hashFiles('yarn.lock') }}-2 - run: yarn install --prefer-offline - name: Enable Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: |- packages/bigquery/lib @@ -148,7 +148,7 @@ jobs: restore-keys: v2-build-output- - run: yarn build - name: Enable NextJS Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: packages/website/.next/cache key: next-${{ hashFiles('yarn.lock') }}