From 5f99c4378f579d43ba48b6b9fb5f7f837395719c Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Fri, 29 Jan 2021 22:57:12 -0800 Subject: [PATCH] Fix benchstat --- .github/workflows/benchstat.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/benchstat.yml b/.github/workflows/benchstat.yml index adbb52d..4fa343f 100644 --- a/.github/workflows/benchstat.yml +++ b/.github/workflows/benchstat.yml @@ -1,10 +1,8 @@ -# This workflow runs benchmarks against the current branch, compares them to benchmarks against -# master, and uploads the results as an artifact. +# This workflow runs benchmarks against the current branch, +# compares them to benchmarks against master, +# and uploads the results as an artifact. -# TODO: This workflow could be improved by only running on pull requests and then posting the results back -# as a comment in the pull request. - -name: Benchstat +name: benchstat on: [pull_request] @@ -24,12 +22,12 @@ jobs: with: go-version: 1.15.x - name: Benchmark - run: go test -run=^$ -bench=. -count=5 -timeout=60m ./... | tee -a bench.txt + run: go test -run=^$ -bench=. -count=5 -timeout=60m ./... | tee -a new.txt - name: Upload Benchmark uses: actions/upload-artifact@v2 with: name: bench-incoming - path: bench.txt + path: new.txt current: runs-on: ubuntu-latest @@ -48,12 +46,12 @@ jobs: with: go-version: 1.15.x - name: Benchmark - run: go test -run=^$ -bench=. -count=5 -timeout=60m ./... | tee -a bench.txt + run: go test -run=^$ -bench=. -count=5 -timeout=60m ./... | tee -a old.txt - name: Upload Benchmark uses: actions/upload-artifact@v2 with: name: bench-current - path: bench.txt + path: old.txt benchstat: needs: [incoming, current] @@ -76,7 +74,7 @@ jobs: with: name: bench-current - name: Benchstat Results - run: benchstat bench-current/bench.txt bench-incoming/bench.txt | tee -a benchstat.txt + run: benchstat old.txt new.txt | tee -a benchstat.txt - name: Upload benchstat results uses: actions/upload-artifact@v2 with: