Skip to content

Merge pull request #6 from NomicFoundation/cache-address-and-pk #8

Merge pull request #6 from NomicFoundation/cache-address-and-pk

Merge pull request #6 from NomicFoundation/cache-address-and-pk #8

Workflow file for this run

name: VM
on:
push:
branches: [master, develop]
tags: ['*']
env:
cwd: ${{github.workspace}}/packages/vm
defaults:
run:
working-directory: packages/vm
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-vm-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run lint
- run: npm run coverage
- run: npm run test:API:browser
- uses: codecov/codecov-action@v3
with:
files: ${{ env.cwd }}/coverage/lcov.info
flags: vm
test-vm-state:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:state:selectedForks
test-vm-blockchain:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run test:blockchain
vm-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- run: npm ci
working-directory: ${{github.workspace}}
- run: npm run build:benchmarks
working-directory: ${{ env.cwd }}
- run: npm run benchmarks -- mainnetBlocks:10 | tee output.txt
working-directory: ${{ env.cwd }}
# Run git stash in case github-action-benchmark has trouble switching to gh-pages branch due to differing package-locks
- run: git stash
- name: Compare benchmarks
uses: rhysd/github-action-benchmark@v1
if: github.ref == 'refs/heads/master'
with:
tool: 'benchmarkjs'
# Where the output from the benchmark tool is stored
output-file-path: ${{ env.cwd }}/output.txt
# Location of data in gh-pages branch
benchmark-data-dir-path: dev/bench/vm
# Enable alert commit comment (default alert threshold: 200%)
comment-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy to GitHub pages branch automatically (if on master)
auto-push: 'true'
# Only keep and display the last 30 commits worth of benchmark data
max-items-in-chart: 30
# Re-apply git stash to prepare for saving back to cache.
# Avoids exit code 1 by checking if there are changes to be stashed first
- run: STASH_LIST=`git stash list` && [ ! -z $STASH_LIST ] && git stash apply || echo "No files to stash-apply. Skipping…"