Skip to content

Speedup CI with cache #53

Speedup CI with cache

Speedup CI with cache #53

Workflow file for this run

name: Build
on:
push:
branches: [master]
tags: ['*']
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
env:
cwd: ${{github.workspace}}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/cache/restore@v4
id: cache
with:
path: ${{github.workspace}}
key: npm-${{ hashFiles('package-lock.json') }}
- if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
working-directory: ${{github.workspace}}
- if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: ${{github.workspace}}
key: npm-${{ hashFiles('package-lock.json') }}
# Just echoing for now so we can see the cache key
- run: echo npm-${{ hashFiles('package-lock.json') }}
- run: echo ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
block:
needs: build
uses: ./.github/workflows/block-build.yml
with:
cache-key: npm-${{ hashFiles('package-lock.json') }}

Check failure on line 58 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 58, Col: 18): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('package-lock.json')
# blockchain:
# needs: build
# uses: ./.github/workflows/browser.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# browser:
# needs: build
# uses: ./.github/workflows/blockchain-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# client:
# needs: build
# uses: ./.github/workflows/client-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# common:
# needs: build
# uses: ./.github/workflows/common-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# devp2p:
# needs: build
# uses: ./.github/workflows/devp2p-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# ethash:
# needs: build
# uses: ./.github/workflows/ethash-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# evm:
# needs: build
# uses: ./.github/workflows/evm-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# examples:
# needs: build
# uses: ./.github/workflows/examples.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# genesis:
# needs: build
# uses: ./.github/workflows/genesis-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# rlp:
# needs: build
# uses: ./.github/workflows/rlp-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# statemanager:
# needs: build
# uses: ./.github/workflows/statemanager-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# trie:
# needs: build
# uses: ./.github/workflows/trie-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# tx:
# needs: build
# uses: ./.github/workflows/tx-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# util:
# needs: build
# uses: ./.github/workflows/block-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# verkle:
# needs: build
# uses: ./.github/workflows/verkle-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# vm-build:
# needs: build
# uses: ./.github/workflows/vm-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# vm-pr:
# needs: build
# uses: ./.github/workflows/vm-pr.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build
# wallet:
# needs: build
# uses: ./.github/workflows/wallet-build.yml
# with:
# cache-key: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-build