From 34685c4c6ce2eba63063b762ba263b172c499bbf Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sat, 4 May 2024 18:31:25 +1000 Subject: [PATCH] ci: Add a new benchmark recording workflow. --- .github/workflows/benchmark.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 000000000..91e9439f8 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,38 @@ +name: benchmark +on: + # Test new changes + pull_request: + push: + branches: + # Record on merges to main + - main + +jobs: + benchmark: + runs-on: ubuntu-latest + permissions: + # For benchmark-action comment-always + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + cache: true + - run: make bench + env: + HEAD_REF: ${{ env.GITHUB_REF_NAME }} + BENCH_COUNT: 5 + - uses: actions/cache@v4 + with: + path: ./cache + key: ${{ runner.os }}-benchmark + - uses: benchmark-action/github-action-benchmark@v1.20.1 + with: + tool: 'go' + output-file-path: test-results/benchmark-results-${{ env.GITHUB_REF_NAME }}.txt + external-data-json-path: ./cache/benchmark-data.json + save-data-file: ${{ github.event_name !== 'pull_request' }} + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-always: true + summary-always: true