Skip to content

Commit 0dc6335

Browse files
committed
feat: add GitHub action to run post-CI benchmark
1 parent 2bdd9db commit 0dc6335

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

.github/workflows/test-all-packages.yml

+32
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,38 @@ jobs:
7878
- name: lint check
7979
run: yarn lint-check
8080

81+
benchmark:
82+
needs: build
83+
runs-on: ubuntu-latest
84+
strategy:
85+
matrix:
86+
node-version: ['14.x']
87+
steps:
88+
- uses: actions/setup-node@v1
89+
with:
90+
node-version: ${{ matrix.node-version }}
91+
# BEGIN-RESTORE-BOILERPLATE
92+
- name: restore built files
93+
id: built
94+
uses: actions/cache@v1
95+
with:
96+
path: .
97+
key: ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
98+
- uses: actions/checkout@v1
99+
with:
100+
submodules: 'true'
101+
if: steps.built.outputs.cache-hit != 'true'
102+
- name: yarn install
103+
run: yarn install
104+
if: steps.built.outputs.cache-hit != 'true'
105+
- name: yarn build
106+
run: yarn build
107+
if: steps.built.outputs.cache-hit != 'true'
108+
# END-RESTORE-BOILERPLATE
109+
110+
- name: benchmark changes
111+
run: cd packages/swingset-runner && yarn ci:autobench
112+
81113
##################
82114
# Fast-running tests run as a group:
83115
test-quick:

packages/swingset-runner/autobench

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
bin/runner --init --benchmark 100 --statsfile benchstats.json --config demo/exchangeBenchmark/swingset.json run -- --quiet --prime
2+
node --expose-gc -r esm bin/runner --init --benchmark 100 --statsfile benchstats.json --config demo/exchangeBenchmark/swingset.json run -- --quiet --prime

packages/swingset-runner/demo/exchangeBenchmark/bootstrap.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export function buildRootObject(_vatPowers, vatParameters) {
1313
return harden({
1414
async bootstrap(vats, devices) {
1515
let primeContracts = false;
16-
console.log(`@@ params = ${JSON.stringify(vatParameters)}`);
1716
for (const arg of vatParameters.argv) {
1817
if (arg === '--prime') {
1918
primeContracts = true;

packages/swingset-runner/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"test": "ava",
1616
"test:nyc": "nyc ava",
1717
"lint-fix": "eslint --fix '**/*.js'",
18-
"lint-check": "eslint '**/*.js'"
18+
"lint-check": "eslint '**/*.js'",
19+
"ci:autobench": "./autobench"
1920
},
2021
"dependencies": {
2122
"@agoric/assert": "^0.2.0",

0 commit comments

Comments
 (0)