diff --git a/.github/workflows/ci-bench.yml b/.github/workflows/ci-bench.yml index a6cb2207..008c82da 100644 --- a/.github/workflows/ci-bench.yml +++ b/.github/workflows/ci-bench.yml @@ -42,7 +42,10 @@ jobs: go install golang.org/x/perf/cmd/benchstat@latest make bench-diff OUTPUT=$(make print-bench-diff) - echo "output: $OUTPUT" + # because set-output doesn't support multiline content out-of-the-box + OUTPUT="${OUTPUT//'%'/'%25'}" + OUTPUT="${OUTPUT//$'\n'/'%0A'}" + OUTPUT="${OUTPUT//$'\r'/'%0D'}" echo "::set-output name=summary::$OUTPUT" - name: Comment Benchmark Diffs diff --git a/make/bench.mk b/make/bench.mk index 9d144b93..f34670f6 100644 --- a/make/bench.mk +++ b/make/bench.mk @@ -35,11 +35,11 @@ bench-diff: clean generate-optimized check-git-status @echo "generated $(REPORTS_DIR)/v0.7.0.bench" @git checkout $(GITHUB_SHA) @echo "HEAD is now at $(shell git log -1 --format='%h') (expecting $(GITHUB_SHA))" - @echo "Comparing with 'master' branch" - @$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/master.bench - @echo "" - @echo "Comparing with 'v0.7.0' tag" - @$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/v0.7.0.bench | tee $(REPORTS_DIR)/diffs.txt + @echo "Comparing with 'master' branch" > $(REPORTS_DIR)/diffs.txt + @$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/master.bench >> $(REPORTS_DIR)/diffs.txt + @echo "" >> $(REPORTS_DIR)/diffs.txt + @echo "Comparing with 'v0.7.0' tag" >> $(REPORTS_DIR)/diffs.txt + @$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/v0.7.0.bench >> $(REPORTS_DIR)/diffs.txt .PHONY: print-bench-diff print-bench-diff: