1- name : Performance Benchmark
1+ name : Performance Benchmarks
22defaults :
33 run :
44 shell : bash
5-
5+
6+ permissions :
7+ contents : write
8+ pull-requests : write
9+
610env :
711 DOTNET_VERSION : ' 8.0.x'
812
2630 with :
2731 dotnet-version : ${{ env.DOTNET_VERSION }}
2832
33+ - name : Dotnet Build
34+ run : dotnet build ./benchmark/BenchmarkRunner/BenchmarkRunner.csproj -c Release
35+
2936 - name : Load .env file
30373138 with :
3845
3946 - name : Run Benchmark
4047 run : ./benchmark/scripts/run_benchmark_for_db.sh mysql
48+
49+ - name : Upload Results
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : mysql-results
53+ path : benchmark/BenchmarkDotNet.Artifacts/results/*.{md,html,csv}
4154
4255 benchmark-postgresql :
4356 name : PostgreSQL Benchmark
6477 - name : Run Benchmark
6578 run : ./benchmark/scripts/run_benchmark_for_db.sh postgresql
6679
80+ - name : Upload Results
81+ uses : actions/upload-artifact@v4
82+ with :
83+ name : postgresql-results
84+ path : benchmark/BenchmarkDotNet.Artifacts/results/*.{md,html,csv}
85+
6786 benchmark-sqlite :
6887 name : SQLite Benchmark
6988 runs-on : ubuntu-latest
@@ -75,11 +94,67 @@ jobs:
7594 uses : actions/setup-dotnet@v4
7695 with :
7796 dotnet-version : ${{ env.DOTNET_VERSION }}
97+
98+ - name : Dotnet Build
99+ run : dotnet build ./benchmark/BenchmarkRunner/BenchmarkRunner.csproj -c Release
78100
79101 - name : Load .env file
8010281103 with :
82104 load-mode : strict
83105
84106 - name : Run Benchmark
85- run : ./benchmark/scripts/run_benchmark_for_db.sh sqlite
107+ run : ./benchmark/scripts/run_benchmark_for_db.sh sqlite
108+
109+ - name : Upload Results
110+ uses : actions/upload-artifact@v4
111+ with :
112+ name : sqlite-results
113+ path : benchmark/BenchmarkDotNet.Artifacts/results/*.{md,html,csv}
114+
115+ push-results :
116+ name : Push Results
117+ runs-on : ubuntu-latest
118+ if : always()
119+ needs : [benchmark-mysql, benchmark-postgresql, benchmark-sqlite]
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 : Dotnet Build
130+ run : dotnet build ./benchmark/BenchmarkRunner/BenchmarkRunner.csproj -c Release
131+
132+ - name : Download MySQL Results
133+ uses : actions/download-artifact@v4
134+ with :
135+ name : mysql-results
136+ path : benchmark/BenchmarkDotNet.Artifacts/results/mysql
137+
138+ - name : Download PostgreSQL Results
139+ uses : actions/download-artifact@v4
140+ with :
141+ name : postgresql-results
142+ path : benchmark/BenchmarkDotNet.Artifacts/results/postgresql
143+
144+ - name : Download SQLite Results
145+ uses : actions/download-artifact@v4
146+ with :
147+ name : sqlite-results
148+ path : benchmark/BenchmarkDotNet.Artifacts/results/sqlite
149+
150+ - name : Create Pull Request
151+ uses : peter-evans/create-pull-request@v6
152+ env :
153+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154+ with :
155+ base : main
156+ title : update benchmark results
157+ commit-message : update benchmark results
158+ branch : update-benchmark-results
159+ branch-suffix : timestamp
160+ delete-branch : true
0 commit comments