Skip to content

Commit

Permalink
fix(ci): cache ipfs-webui
Browse files Browse the repository at this point in the history
This should stabilize CI by reducing the umber of times we fetch the
same version of ipfs-webui.
  • Loading branch information
lidel committed Oct 1, 2021
1 parent fcbde1b commit 7513ee9
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,52 @@ env:

jobs:

webui:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Cache webui
uses: actions/cache@v2
id: webui-cache
with:
path: assets/webui
key: ${{ hashFiles('package.json') }} # webui CID is defined in this file

- name: Cache bigger downloads
uses: actions/cache@v2
id: cache
if: steps.webui-cache.outputs.cache-hit != 'true'
with:
path: ${{ github.workspace }}/.cache
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'electron-builder.yml') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'electron-builder.yml') }}
${{ runner.os }}-
- name: Install dependencies and fetch ipfs-webui
if: steps.webui-cache.outputs.cache-hit != 'true'
run: |
npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm
npm run clean
npm run build:webui
- name: Attach cached ipfs-webui to Github Action
uses: actions/upload-artifact@v2
with:
name: ipfs-webui
path: assets/webui
if-no-files-found: error

test:
runs-on: ${{ matrix.os }}
needs: webui
strategy:
fail-fast: false
matrix:
Expand All @@ -22,7 +66,14 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: 'lts/*'

- name: Cache webui
uses: actions/cache@v2
id: webui-cache
with:
path: assets/webui
key: ${{ hashFiles('package.json') }}

- name: Cache bigger downloads
uses: actions/cache@v2
Expand Down

0 comments on commit 7513ee9

Please sign in to comment.