Skip to content

Commit

Permalink
feat: add GitHub action to run post-CI benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Feb 11, 2021
1 parent 2bdd9db commit 0dc6335
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,38 @@ jobs:
- name: lint check
run: yarn lint-check

benchmark:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14.x']
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# BEGIN-RESTORE-BOILERPLATE
- name: restore built files
id: built
uses: actions/cache@v1
with:
path: .
key: ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
- uses: actions/checkout@v1
with:
submodules: 'true'
if: steps.built.outputs.cache-hit != 'true'
- name: yarn install
run: yarn install
if: steps.built.outputs.cache-hit != 'true'
- name: yarn build
run: yarn build
if: steps.built.outputs.cache-hit != 'true'
# END-RESTORE-BOILERPLATE

- name: benchmark changes
run: cd packages/swingset-runner && yarn ci:autobench

##################
# Fast-running tests run as a group:
test-quick:
Expand Down
2 changes: 1 addition & 1 deletion packages/swingset-runner/autobench
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
bin/runner --init --benchmark 100 --statsfile benchstats.json --config demo/exchangeBenchmark/swingset.json run -- --quiet --prime
node --expose-gc -r esm bin/runner --init --benchmark 100 --statsfile benchstats.json --config demo/exchangeBenchmark/swingset.json run -- --quiet --prime
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export function buildRootObject(_vatPowers, vatParameters) {
return harden({
async bootstrap(vats, devices) {
let primeContracts = false;
console.log(`@@ params = ${JSON.stringify(vatParameters)}`);
for (const arg of vatParameters.argv) {
if (arg === '--prime') {
primeContracts = true;
Expand Down
3 changes: 2 additions & 1 deletion packages/swingset-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"test": "ava",
"test:nyc": "nyc ava",
"lint-fix": "eslint --fix '**/*.js'",
"lint-check": "eslint '**/*.js'"
"lint-check": "eslint '**/*.js'",
"ci:autobench": "./autobench"
},
"dependencies": {
"@agoric/assert": "^0.2.0",
Expand Down

0 comments on commit 0dc6335

Please sign in to comment.