Skip to content

Commit

Permalink
use dep cache in gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Aug 13, 2020
1 parent 3992124 commit 1c55b9c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/vm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,35 @@ jobs:
node-version: 12.x
- uses: actions/checkout@v2

- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
working-directory: ${{github.workspace}}

- run: npm run build:benchmarks
- run: npm run benchmarks -- 5 | tee output.txt
working-directory: ${{ env.cwd }}

- run: npm run benchmarks -- 10 | tee output.txt
working-directory: ${{ env.cwd }}

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: 'benchmarkjs'
# Where the output from the benchmark tool is stored
output-file-path: output.txt
output-file-path: ${{ env.cwd }}/output.txt
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
Expand Down
5 changes: 2 additions & 3 deletions packages/vm/scripts/benchmarks/mainnetBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const suite = new Benchmark.Suite()

async function main() {
const args = process.argv
if (args.length !== 3 && args.length !== 4) {
if (args.length < 3 || args.length > 4) {
console.log('Insufficient arguments')
console.log('Usage: node BENCHMARK_SCRIPT BLOCK_FIXTURE [NUM_SAMPLES]')
return process.exit(1)
Expand Down Expand Up @@ -48,10 +48,9 @@ async function main() {

suite
.on('cycle', function (event: any) {
console.log(event)
console.log(String(event.target))
})
.run({ async: true })
.run()
}

export interface StateTestPreAccount {
Expand Down

0 comments on commit 1c55b9c

Please sign in to comment.