Skip to content

Persist benchmark results in CI #44

Persist benchmark results in CI

Persist benchmark results in CI #44

Workflow file for this run

name: Benchmark
on:
# For testing, remove before merge:
pull_request:
push:
branches:
- main
permissions:
contents: read
packages: read
jobs:
benchmark:
name: 'benchmark (pg: ${{ matrix.pgVersion }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pgVersion: ['14.8', '15.3', '16.4', '17.0' ,'latest']
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run benchmarks
run: make bench
env:
POSTGRES_VERSION: ${{ matrix.pgVersion }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: benchmark_result_${{ matrix.pgVersion }}.json
path: internal/benchmarks/benchmark_result_${{ matrix.pgVersion }}.json
gather:
name: 'Gather results'
runs-on: ubuntu-latest
needs: [benchmark]
steps:
- uses: actions/download-artifact@v4
with:
path: ./results/
merge-multiple: true
- name: Combine all results
run: cat results/*.json > ${{github.sha}}_benchmark_result.json
- name: Upload combined results
uses: actions/upload-artifact@v4
with:
name: ${{github.sha}}_benchmark_result.json
path: ${{github.sha}}_benchmark_result.json