Skip to content

Commit

Permalink
chore: fix ci cache (#2811)
Browse files Browse the repository at this point in the history
The `path` arg to `actions/cache` has to be the same every time it is used
  • Loading branch information
achingbrain authored Nov 7, 2024
1 parent 6bd7f91 commit 5feba91
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
branches:
- '**'

env:
CACHE_DIRS: |
./interop/dist
./interop/node_modules
./doc/node_modules
jobs:

build:
Expand All @@ -18,10 +24,7 @@ jobs:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
./interop/dist
./interop/node_modules
./doc/node_modules
directories: ${{ env.CACHE_DIRS }}

check:
needs: build
Expand All @@ -32,6 +35,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present lint
- run: npm run --if-present dep-check
- run: npm run --if-present docs:no-publish
Expand All @@ -50,6 +55,8 @@ jobs:
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:node
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -66,6 +73,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:chrome
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -82,6 +91,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -98,6 +109,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:firefox
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -114,6 +127,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -130,6 +145,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
# https://github.com/actions/runner-images/issues/9733#issuecomment-2074590278
- run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
Expand All @@ -151,6 +168,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npx xvfb-maybe npm run --if-present test:electron-main
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -167,6 +186,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
Expand All @@ -183,6 +204,8 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- run: npm run test:interop -- --bail

transport-interop:
Expand All @@ -195,9 +218,7 @@ jobs:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
./interop/dist
./interop/node_modules
directories: ${{ env.CACHE_DIRS }}
- name: Build images
run: (cd interop && make -j 4)
- name: Save package-lock.json as artifact
Expand Down Expand Up @@ -249,6 +270,8 @@ jobs:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: ${{ env.CACHE_DIRS }}
- uses: ipfs/aegir/actions/docker-login@master
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
Expand Down

0 comments on commit 5feba91

Please sign in to comment.