Skip to content

Commit

Permalink
multiline
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon committed Apr 19, 2022
1 parent a4daa56 commit 5c78697
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions make/bench.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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" > diffs.txt
@$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/master.bench >> diffs.txt
@echo "" >> diffs.txt
@echo "Comparing with 'v0.7.0' tag" >> diffs.txt
@$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/v0.7.0.bench >> diffs.txt

.PHONY: print-bench-diff
print-bench-diff:
Expand Down

0 comments on commit 5c78697

Please sign in to comment.