Skip to content

Commit d5ac532

Browse files
fix: update benchmark.yml
1 parent d870cfd commit d5ac532

File tree

1 file changed

+137
-24
lines changed

1 file changed

+137
-24
lines changed

.github/workflows/benchmark.yml

Lines changed: 137 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ on:
1818
workflow_dispatch:
1919

2020
jobs:
21-
benchmark-mysql:
22-
name: MySQL Benchmark
21+
benchmark-mysql-reads:
22+
name: MySQL Reads Benchmark
2323
runs-on: ubuntu-latest
2424

2525
steps:
@@ -41,17 +41,49 @@ jobs:
4141
services: mysqldb
4242

4343
- name: Run Benchmark
44-
run: ./benchmark/scripts/run_benchmark_for_db.sh mysql
44+
run: ./benchmark/scripts/run_single_benchmark.sh mysql reads
4545

4646
- name: Upload Results
4747
uses: actions/upload-artifact@v4
4848
if: success()
4949
with:
50-
name: mysql-results
51-
path: benchmark/BenchmarkDotNet.Artifacts/results/mysql/
50+
name: mysql-reads-results
51+
path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads
52+
53+
benchmark-mysql-writes:
54+
name: MySQL Writes Benchmark
55+
runs-on: ubuntu-latest
5256

53-
benchmark-postgresql:
54-
name: PostgreSQL Benchmark
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Set up .NET
61+
uses: actions/setup-dotnet@v4
62+
with:
63+
dotnet-version: ${{ env.DOTNET_VERSION }}
64+
65+
- name: Load .env file
66+
uses: xom9ikk/[email protected]
67+
with:
68+
load-mode: strict
69+
70+
- name: Docker compose
71+
uses: hoverkraft-tech/[email protected]
72+
with:
73+
services: mysqldb
74+
75+
- name: Run Benchmark
76+
run: ./benchmark/scripts/run_single_benchmark.sh mysql writes
77+
78+
- name: Upload Results
79+
uses: actions/upload-artifact@v4
80+
if: success()
81+
with:
82+
name: mysql-writes-results
83+
path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes
84+
85+
benchmark-postgresql-reads:
86+
name: PostgreSQL Reads Benchmark
5587
runs-on: ubuntu-latest
5688

5789
steps:
@@ -73,16 +105,48 @@ jobs:
73105
services: postgresdb
74106

75107
- name: Run Benchmark
76-
run: ./benchmark/scripts/run_benchmark_for_db.sh postgresql
108+
run: ./benchmark/scripts/run_single_benchmark.sh postgresql reads
77109

78110
- name: Upload Results
79111
uses: actions/upload-artifact@v4
80112
if: success()
81113
with:
82-
name: postgresql-results
83-
path: benchmark/BenchmarkDotNet.Artifacts/results/postgresql/
114+
name: postgresql-reads-results
115+
path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads
116+
117+
benchmark-postgresql-writes:
118+
name: PostgreSQL Writes Benchmark
119+
runs-on: ubuntu-latest
120+
121+
steps:
122+
- uses: actions/checkout@v4
123+
124+
- name: Set up .NET
125+
uses: actions/setup-dotnet@v4
126+
with:
127+
dotnet-version: ${{ env.DOTNET_VERSION }}
128+
129+
- name: Load .env file
130+
uses: xom9ikk/[email protected]
131+
with:
132+
load-mode: strict
84133

85-
benchmark-sqlite:
134+
- name: Docker compose
135+
uses: hoverkraft-tech/[email protected]
136+
with:
137+
services: postgresdb
138+
139+
- name: Run Benchmark
140+
run: ./benchmark/scripts/run_single_benchmark.sh postgresql writes
141+
142+
- name: Upload Results
143+
uses: actions/upload-artifact@v4
144+
if: success()
145+
with:
146+
name: postgresql-writes-results
147+
path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes
148+
149+
benchmark-sqlite-reads:
86150
name: SQLite Benchmark
87151
runs-on: ubuntu-latest
88152

@@ -100,41 +164,90 @@ jobs:
100164
load-mode: strict
101165

102166
- name: Run Benchmark
103-
run: ./benchmark/scripts/run_benchmark_for_db.sh sqlite
167+
run: ./benchmark/scripts/run_single_benchmark.sh sqlite reads
104168

105169
- name: Upload Results
106170
uses: actions/upload-artifact@v4
107171
if: success()
108172
with:
109-
name: sqlite-results
110-
path: benchmark/BenchmarkDotNet.Artifacts/results/sqlite/
173+
name: sqlite-reads-results
174+
path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads
111175

176+
benchmark-sqlite-writes:
177+
name: SQLite Writes Benchmark
178+
runs-on: ubuntu-latest
179+
180+
steps:
181+
- uses: actions/checkout@v4
182+
183+
- name: Set up .NET
184+
uses: actions/setup-dotnet@v4
185+
with:
186+
dotnet-version: ${{ env.DOTNET_VERSION }}
187+
188+
- name: Load .env file
189+
uses: xom9ikk/[email protected]
190+
with:
191+
load-mode: strict
192+
193+
- name: Run Benchmark
194+
run: ./benchmark/scripts/run_single_benchmark.sh sqlite writes
195+
196+
- name: Upload Results
197+
uses: actions/upload-artifact@v4
198+
if: success()
199+
with:
200+
name: sqlite-writes-results
201+
path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes
202+
112203
push-results:
113204
name: Push Results
114205
runs-on: ubuntu-latest
115206
if: always()
116-
needs: [benchmark-mysql, benchmark-postgresql, benchmark-sqlite]
207+
needs: [
208+
benchmark-mysql-reads, benchmark-mysql-writes,
209+
benchmark-postgresql-reads, benchmark-postgresql-writes,
210+
benchmark-sqlite-reads, benchmark-sqlite-writes
211+
]
117212

118213
steps:
119214
- uses: actions/checkout@v4
120215

121-
- name: Download MySQL Results
216+
- name: Download MySQL Reads Results
217+
uses: actions/download-artifact@v4
218+
with:
219+
name: mysql-reads-results
220+
path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads
221+
222+
- name: Download MySQL Writes Results
223+
uses: actions/download-artifact@v4
224+
with:
225+
name: mysql-writes-results
226+
path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes
227+
228+
- name: Download PostgreSQL Reads Results
229+
uses: actions/download-artifact@v4
230+
with:
231+
name: postgresql-reads-results
232+
path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads
233+
234+
- name: Download PostgreSQL Writes Results
122235
uses: actions/download-artifact@v4
123236
with:
124-
name: mysql-results
125-
path: benchmark/BenchmarkDotNet.Artifacts/mysql
237+
name: postgresql-writes-results
238+
path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes
126239

127-
- name: Download PostgreSQL Results
240+
- name: Download SQLite Reads Results
128241
uses: actions/download-artifact@v4
129242
with:
130-
name: postgresql-results
131-
path: benchmark/BenchmarkDotNet.Artifacts/postgresql
243+
name: sqlite-reads-results
244+
path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads
132245

133-
- name: Download SQLite Results
246+
- name: Download SQLite Writes Results
134247
uses: actions/download-artifact@v4
135248
with:
136-
name: sqlite-results
137-
path: benchmark/BenchmarkDotNet.Artifacts/sqlite
249+
name: sqlite-writes-results
250+
path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes
138251

139252
- name: Create Pull Request
140253
uses: peter-evans/create-pull-request@v6

0 commit comments

Comments
 (0)