1
+ name : Benchmark.js Example
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+ branches :
8
+ - main
9
+
10
+ permissions :
11
+ contents : write
12
+ deployments : write
13
+
14
+ jobs :
15
+ benchmark :
16
+ name : Run JavaScript benchmark example
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v2
20
+ - uses : actions/setup-node@v1
21
+ - name : Run benchmark
22
+ run : cd packages/cactus-plugin-ledger-connector-besu/src/test/benchmarkjs && npm install && node bench.js | tee output.txt
23
+
24
+ - name : Commit changes
25
+ run : |
26
+ git add packages/cactus-plugin-ledger-connector-besu/src/test/benchmarkjs/package.json
27
+ git commit -s -m "Committing changes to package.json"
28
+ if : github.event_name == 'push'
29
+
30
+ - name : Stash changes
31
+ run : git stash
32
+ if : github.event_name == 'pull_request'
33
+
34
+ - name : Store benchmark result
35
+ uses : benchmark-action/github-action-benchmark@v1
36
+ with :
37
+ tool : ' benchmarkjs'
38
+ output-file-path : packages/cactus-plugin-ledger-connector-besu/src/test/benchmarkjs/output.txt
39
+ github-token : ${{ secrets.GITHUB_TOKEN }}
40
+ auto-push : true
41
+ # Show alert with commit comment on detecting possible performance regression
42
+ alert-threshold : ' 200%'
43
+ comment-on-alert : true
44
+ fail-on-alert : true
45
+
46
+ # - name: Store benchmark result - separate results repo
47
+ # uses: benchmark-action/github-action-benchmark@v1
48
+ # with:
49
+ # name: Benchmark.js Benchmark
50
+ # tool: 'benchmarkjs'
51
+ # output-file-path: packages/cactus-plugin-ledger-connector-besu/src/test/benchmarkjs/output.txt
52
+ # github-token: ${{ secrets.BENCHMARK_ACTION_BOT_TOKEN }}
53
+ # auto-push: true
54
+ # # Show alert with commit comment on detecting possible performance regression
55
+ # alert-threshold: '200%'
56
+ # comment-on-alert: true
57
+ # fail-on-alert: true
58
+ # gh-repository: 'github.com/benchmark-action/github-action-benchmark-results'
0 commit comments