From 225563804e1a905a818896897f322e0e136d287a Mon Sep 17 00:00:00 2001 From: Joachim Viide Date: Mon, 18 Mar 2024 17:10:23 +0000 Subject: [PATCH] build(actions): update actions, use actions/setup-node's builtin caching --- .github/workflows/ci.yml | 17 +++-------------- .github/workflows/release.yml | 18 +++--------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97a993db..6ace9904 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,22 +14,11 @@ jobs: name: Build & Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - # This uses the same name as the build-action so we can share the caches. - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: npm - run: npm ci - name: test # Not using `npm test` since it rebuilds source which npm ci has already done diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8194f12c..c54d5463 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,28 +16,16 @@ jobs: pull-requests: write steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - name: Setup Node.js 18.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - # This uses the same name as the build-action so we can share the caches. - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: npm - name: Install Dependencies run: npm ci