-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (71 loc) · 1.98 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Benchmark Node.js PostgreSQL vs MySQL vs MongoDB
on:
push:
branches:
- main
workflow_dispatch:
permissions: write-all
jobs:
bench:
name: Benchmark
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.3
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mongodb:
image: mongo:5.0.26
env:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
MONGO_INITDB_DATABASE: APP-DATABASE
ports:
- 27017:27017
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: mysqltest
MYSQL_USER: mysqltest
MYSQL_PASSWORD: mysqltest
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Verify MySQL connection and mysqltest DB exists
run: mysql --host 0.0.0.0 --port 3306 -umysqltest -pmysqltest -e "SHOW DATABASES LIKE 'mysqltest'"
- uses: actions/checkout@v4
with:
persist-credentials: true
ref: ${{ github.head_ref }}
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 22
- name: Install dependencies
run: npm i
- name: Run Benchmark
run: node benchmark.js > "./results/test_$(date '+%Y-%m-%d_%H-%M-%S').txt"
- name: Update README.md
run: node update-readme.js
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions