Skip to content

Commit

Permalink
Merge pull request #342 from jviide/up
Browse files Browse the repository at this point in the history
build(actions): update actions, use actions/setup-node's builtin caching
  • Loading branch information
marvinhagemeister authored Mar 18, 2024
2 parents 4521894 + 2255638 commit e3326e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3326e2

Please sign in to comment.