Skip to content

Commit 0dd8e16

Browse files
authored
Add benchmark workflow (#1406)
Add benchmark workflow
1 parent baf2fff commit 0dd8e16

33 files changed

+298
-54839
lines changed

.github/workflows/benchmark.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Benchmark
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
workflow_dispatch:
9+
10+
env:
11+
MYSQL_PORT: 3306
12+
MYSQL_USER: root
13+
MYSQL_DATABASE: test
14+
15+
jobs:
16+
benchmark:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [16.x]
22+
mysql-version: ["mysql:8.0.18"]
23+
use-compression: [0]
24+
use-tls: [0]
25+
26+
name: Performance regression check
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
# - name: Set up MySQL
32+
# run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_ROOT_PASSWORD=${{ env.MYSQL_PASSWORD }} -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/examples/custom-conf:/etc/mysql/conf.d -v $PWD/examples/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
33+
- name: Set up Node.js ${{ matrix.node-version }}
34+
uses: actions/setup-node@v2
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
38+
- name: Cache dependencies
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.npm
42+
key: npm-${{ hashFiles('package-lock.json') }}
43+
restore-keys: npm-
44+
45+
- name: Install npm dependencies
46+
run: npm ci
47+
48+
# - name: Wait mysql server is ready
49+
# run: node tools/wait-up.js
50+
51+
- name: Run benchmark
52+
run: node benchmarks/benchmark.js | tee output.txt
53+
54+
- name: Download previous benchmark data
55+
uses: actions/cache@v1
56+
with:
57+
path: ./cache
58+
key: ${{ runner.os }}-benchmark
59+
60+
- name: Store benchmark result
61+
uses: benchmark-action/github-action-benchmark@v1
62+
with:
63+
tool: 'benchmarkjs'
64+
output-file-path: output.txt
65+
external-data-json-path: ./cache/benchmark-data.json
66+
fail-on-alert: false
67+
auto-push: false
68+
alert-threshold: '150%'
69+
github-token: ${{ secrets.GITHUB_TOKEN }}
70+
comment-on-alert: true
71+
alert-comment-cc-users: '@sidorares'

.github/workflows/ci-linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ jobs:
3838
use-tls: 1
3939
- node-version: "14.x"
4040
mysql-version: "mysql:5.7"
41+
use-compression: 0
42+
use-tls: 0
4143
- node-version: "12.x"
4244
mysql-version: "mysql:5.7"
45+
use-compression: 0
46+
use-tls: 0
4347
- filter: "5.1only"
4448
node-version: "16.x"
4549
mysql-version: "datagrip/mysql:5.1"
50+
use-compression: 0
51+
use-tls: 0
4652

4753
name: Node.js ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
4854

.travis.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

benchmarks/.eslintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

benchmarks/FB/create.sql

Lines changed: 0 additions & 58 deletions
This file was deleted.

benchmarks/FB/fortunes.jade

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)