Skip to content

Commit

Permalink
use GITHUB_SHA
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon committed Apr 18, 2022
1 parent ee8cfa6 commit 85aa8fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions make/bench.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ bench: clean generate-optimized
@mkdir -p $(REPORTS_DIR)
@go test -tags bench -bench=. -benchmem -count=$(BENCH_COUNT) -run=XXX \
github.com/bytesparadise/libasciidoc \
| tee $(REPORTS_DIR)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench
@echo "generated $(REPORTS_DIR)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench"
| tee $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench
@echo "generated $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench"

.PHONY: bench-diff
## run the top-level benchmarks and compares with results of 'master' and 'v0.7.0'
Expand All @@ -21,8 +21,8 @@ bench-diff: clean generate-optimized check-git-status
@mkdir -p $(REPORTS_DIR)
@go test -tags bench -bench=. -benchmem -count=$(BENCH_COUNT) -run=XXX \
github.com/bytesparadise/libasciidoc \
| tee $(REPORTS_DIR)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench
@echo "generated $(REPORTS_DIR)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench"
| tee $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench
@echo "generated $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench"
@git checkout master
@go test -tags bench -bench=. -benchmem -count=$(BENCH_COUNT) -run=XXX \
github.com/bytesparadise/libasciidoc \
Expand All @@ -33,13 +33,13 @@ bench-diff: clean generate-optimized check-git-status
github.com/bytesparadise/libasciidoc \
| tee $(REPORTS_DIR)/v0.7.0.bench
@echo "generated $(REPORTS_DIR)/v0.7.0.bench"
@git checkout $(GIT_BRANCH_NAME)
@echo "HEAD is now at $(git rev-parse --abbrev-ref HEAD) (expecting $(GIT_BRANCH_NAME))"
@git checkout $(GITHUB_SHA)
@echo "HEAD is now at $(git rev-parse --abbrev-ref HEAD) (expecting $(GITHUB_SHA))"
@echo "Comparing with 'master' branch"
@$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/master.bench
@$(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)/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/v0.7.0.bench | tee $(REPORTS_DIR)/diffs.txt
@$(GOPATH)/bin/benchstat $(REPORTS_DIR)/$(GITHUB_SHA)-$(GIT_COMMIT_ID_SHORT).bench $(REPORTS_DIR)/v0.7.0.bench | tee $(REPORTS_DIR)/diffs.txt

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

0 comments on commit 85aa8fc

Please sign in to comment.