|
| 1 | +name: Performance Benchmarks |
| 2 | +defaults: |
| 3 | + run: |
| 4 | + shell: bash |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: write |
| 8 | + pull-requests: write |
| 9 | + |
| 10 | +env: |
| 11 | + DOTNET_VERSION: '8.0.x' |
| 12 | + |
| 13 | +on: |
| 14 | + release: |
| 15 | + types: [ published ] |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +jobs: |
| 19 | + benchmark-mysql-reads: |
| 20 | + name: MySQL Reads Benchmark |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up .NET |
| 27 | + uses: actions/setup-dotnet@v4 |
| 28 | + with: |
| 29 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 30 | + |
| 31 | + - name: Load .env file |
| 32 | + uses: xom9ikk/dotenv@v2.3.0 |
| 33 | + with: |
| 34 | + load-mode: strict |
| 35 | + |
| 36 | + - name: Docker compose |
| 37 | + uses: hoverkraft-tech/compose-action@v1.5.1 |
| 38 | + with: |
| 39 | + services: mysqldb |
| 40 | + |
| 41 | + - name: Run Benchmark |
| 42 | + run: ./benchmark/scripts/run_single_benchmark.sh mysql reads |
| 43 | + |
| 44 | + - name: Upload Results |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + if: success() |
| 47 | + with: |
| 48 | + name: mysql-reads-results |
| 49 | + path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads |
| 50 | + |
| 51 | + benchmark-mysql-writes: |
| 52 | + name: MySQL Writes Benchmark |
| 53 | + runs-on: ubuntu-latest |
| 54 | + |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Set up .NET |
| 59 | + uses: actions/setup-dotnet@v4 |
| 60 | + with: |
| 61 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 62 | + |
| 63 | + - name: Load .env file |
| 64 | + uses: xom9ikk/dotenv@v2.3.0 |
| 65 | + with: |
| 66 | + load-mode: strict |
| 67 | + |
| 68 | + - name: Docker compose |
| 69 | + uses: hoverkraft-tech/compose-action@v1.5.1 |
| 70 | + with: |
| 71 | + services: mysqldb |
| 72 | + |
| 73 | + - name: Run Benchmark |
| 74 | + run: ./benchmark/scripts/run_single_benchmark.sh mysql writes |
| 75 | + |
| 76 | + - name: Upload Results |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + if: success() |
| 79 | + with: |
| 80 | + name: mysql-writes-results |
| 81 | + path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes |
| 82 | + |
| 83 | + benchmark-postgresql-reads: |
| 84 | + name: PostgreSQL Reads Benchmark |
| 85 | + runs-on: ubuntu-latest |
| 86 | + |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v4 |
| 89 | + |
| 90 | + - name: Set up .NET |
| 91 | + uses: actions/setup-dotnet@v4 |
| 92 | + with: |
| 93 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 94 | + |
| 95 | + - name: Load .env file |
| 96 | + uses: xom9ikk/dotenv@v2.3.0 |
| 97 | + with: |
| 98 | + load-mode: strict |
| 99 | + |
| 100 | + - name: Docker compose |
| 101 | + uses: hoverkraft-tech/compose-action@v1.5.1 |
| 102 | + with: |
| 103 | + services: postgresdb |
| 104 | + |
| 105 | + - name: Run Benchmark |
| 106 | + run: ./benchmark/scripts/run_single_benchmark.sh postgresql reads |
| 107 | + |
| 108 | + - name: Upload Results |
| 109 | + uses: actions/upload-artifact@v4 |
| 110 | + if: success() |
| 111 | + with: |
| 112 | + name: postgresql-reads-results |
| 113 | + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads |
| 114 | + |
| 115 | + benchmark-postgresql-writes: |
| 116 | + name: PostgreSQL Writes Benchmark |
| 117 | + runs-on: ubuntu-latest |
| 118 | + |
| 119 | + steps: |
| 120 | + - uses: actions/checkout@v4 |
| 121 | + |
| 122 | + - name: Set up .NET |
| 123 | + uses: actions/setup-dotnet@v4 |
| 124 | + with: |
| 125 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 126 | + |
| 127 | + - name: Load .env file |
| 128 | + uses: xom9ikk/dotenv@v2.3.0 |
| 129 | + with: |
| 130 | + load-mode: strict |
| 131 | + |
| 132 | + - name: Docker compose |
| 133 | + uses: hoverkraft-tech/compose-action@v1.5.1 |
| 134 | + with: |
| 135 | + services: postgresdb |
| 136 | + |
| 137 | + - name: Run Benchmark |
| 138 | + run: ./benchmark/scripts/run_single_benchmark.sh postgresql writes |
| 139 | + |
| 140 | + - name: Upload Results |
| 141 | + uses: actions/upload-artifact@v4 |
| 142 | + if: success() |
| 143 | + with: |
| 144 | + name: postgresql-writes-results |
| 145 | + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes |
| 146 | + |
| 147 | + benchmark-sqlite-reads: |
| 148 | + name: SQLite Reads Benchmark |
| 149 | + runs-on: ubuntu-latest |
| 150 | + |
| 151 | + steps: |
| 152 | + - uses: actions/checkout@v4 |
| 153 | + |
| 154 | + - name: Set up .NET |
| 155 | + uses: actions/setup-dotnet@v4 |
| 156 | + with: |
| 157 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 158 | + |
| 159 | + - name: Load .env file |
| 160 | + uses: xom9ikk/dotenv@v2.3.0 |
| 161 | + with: |
| 162 | + load-mode: strict |
| 163 | + |
| 164 | + - name: Run Benchmark |
| 165 | + run: ./benchmark/scripts/run_single_benchmark.sh sqlite reads |
| 166 | + |
| 167 | + - name: Upload Results |
| 168 | + uses: actions/upload-artifact@v4 |
| 169 | + if: success() |
| 170 | + with: |
| 171 | + name: sqlite-reads-results |
| 172 | + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads |
| 173 | + |
| 174 | + benchmark-sqlite-writes: |
| 175 | + name: SQLite Writes Benchmark |
| 176 | + runs-on: ubuntu-latest |
| 177 | + |
| 178 | + steps: |
| 179 | + - uses: actions/checkout@v4 |
| 180 | + |
| 181 | + - name: Set up .NET |
| 182 | + uses: actions/setup-dotnet@v4 |
| 183 | + with: |
| 184 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
| 185 | + |
| 186 | + - name: Load .env file |
| 187 | + uses: xom9ikk/dotenv@v2.3.0 |
| 188 | + with: |
| 189 | + load-mode: strict |
| 190 | + |
| 191 | + - name: Run Benchmark |
| 192 | + run: ./benchmark/scripts/run_single_benchmark.sh sqlite writes |
| 193 | + |
| 194 | + - name: Upload Results |
| 195 | + uses: actions/upload-artifact@v4 |
| 196 | + if: success() |
| 197 | + with: |
| 198 | + name: sqlite-writes-results |
| 199 | + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes |
| 200 | + |
| 201 | + push-results: |
| 202 | + name: Push Results |
| 203 | + runs-on: ubuntu-latest |
| 204 | + if: always() |
| 205 | + needs: [ |
| 206 | + benchmark-mysql-reads, benchmark-mysql-writes, |
| 207 | + benchmark-postgresql-reads, benchmark-postgresql-writes, |
| 208 | + benchmark-sqlite-reads, benchmark-sqlite-writes |
| 209 | + ] |
| 210 | + |
| 211 | + steps: |
| 212 | + - uses: actions/checkout@v4 |
| 213 | + |
| 214 | + - name: Download MySQL Reads Results |
| 215 | + uses: actions/download-artifact@v4 |
| 216 | + with: |
| 217 | + name: mysql-reads-results |
| 218 | + path: benchmark/BenchmarkDotNet.Artifacts/mysql/reads |
| 219 | + |
| 220 | + - name: Download MySQL Writes Results |
| 221 | + uses: actions/download-artifact@v4 |
| 222 | + with: |
| 223 | + name: mysql-writes-results |
| 224 | + path: benchmark/BenchmarkDotNet.Artifacts/mysql/writes |
| 225 | + |
| 226 | + - name: Download PostgreSQL Reads Results |
| 227 | + uses: actions/download-artifact@v4 |
| 228 | + with: |
| 229 | + name: postgresql-reads-results |
| 230 | + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/reads |
| 231 | + |
| 232 | + - name: Download PostgreSQL Writes Results |
| 233 | + uses: actions/download-artifact@v4 |
| 234 | + with: |
| 235 | + name: postgresql-writes-results |
| 236 | + path: benchmark/BenchmarkDotNet.Artifacts/postgresql/writes |
| 237 | + |
| 238 | + - name: Download SQLite Reads Results |
| 239 | + uses: actions/download-artifact@v4 |
| 240 | + with: |
| 241 | + name: sqlite-reads-results |
| 242 | + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/reads |
| 243 | + |
| 244 | + - name: Download SQLite Writes Results |
| 245 | + uses: actions/download-artifact@v4 |
| 246 | + with: |
| 247 | + name: sqlite-writes-results |
| 248 | + path: benchmark/BenchmarkDotNet.Artifacts/sqlite/writes |
| 249 | + |
| 250 | + - name: Create Pull Request |
| 251 | + uses: peter-evans/create-pull-request@v6 |
| 252 | + env: |
| 253 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 254 | + with: |
| 255 | + base: main |
| 256 | + title: update benchmark results |
| 257 | + commit-message: update benchmark results |
| 258 | + branch: update-benchmark-results |
| 259 | + branch-suffix: timestamp |
| 260 | + delete-branch: true |
0 commit comments