-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maint: update go version and docs (#223)
## Which problem is this PR solving? - preparation for release ## Short description of the changes - (try to update licenses, apparently no licenses needed updates for this release but since it took these changes to find that out I figured they were worth keeping) - add Makefile based on Refinery's Makefile for easier license updates (and easier testing 😄 ) - update version in `.go-version` to match #222 - update releasing file to use new make targets and add more detail to process - add verify-licenses to test step in ci ## How to verify that this has the expected result run the make targets and it should all work
- Loading branch information
1 parent
ea8e3ac
commit 550ff37
Showing
4 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.20.3 | ||
1.23.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
MAKEFLAGS += --no-builtin-variables | ||
|
||
GOTESTCMD = $(if $(shell command -v gotestsum),gotestsum --junitfile ./test_results/$(1).xml --format testname --,go test) | ||
|
||
.PHONY: test | ||
#: run all tests | ||
test: test_with_race test_all | ||
|
||
.PHONY: test_with_race | ||
#: run only tests tagged with potential race conditions | ||
test_with_race: test_results | ||
@echo | ||
@echo "+++ testing - race conditions?" | ||
@echo | ||
$(call GOTESTCMD,$@) -tags race --race --timeout 60s -v ./... | ||
|
||
.PHONY: test_all | ||
#: run all tests, but with no race condition detection | ||
test_all: test_results | ||
@echo | ||
@echo "+++ testing - all the tests" | ||
@echo | ||
$(call GOTESTCMD,$@) -tags all --timeout 60s -v ./... | ||
|
||
test_results: | ||
@mkdir -p test_results | ||
|
||
.PHONY: install-tools | ||
install-tools: | ||
go install github.com/google/go-licenses/[email protected] | ||
|
||
.PHONY: update-licenses | ||
update-licenses: install-tools | ||
rm -rf LICENSES; \ | ||
#: We ignore the standard library (go list std) as a workaround for \ | ||
"https://github.com/google/go-licenses/issues/244." The awk script converts the output \ | ||
of `go list std` (line separated modules) to the input that `--ignore` expects (comma separated modules). | ||
go-licenses save --save_path LICENSES --ignore "github.com/honeycombio/buildevents" \ | ||
--ignore $(shell go list std | awk 'NR > 1 { printf(",") } { printf("%s",$$0) } END { print "" }') ./; | ||
|
||
|
||
.PHONY: verify-licenses | ||
verify-licenses: install-tools | ||
go-licenses save --save_path temp --ignore "github.com/honeycombio/buildevents" \ | ||
--ignore $(shell go list std | awk 'NR > 1 { printf(",") } { printf("%s",$$0) } END { print "" }') ./; \ | ||
chmod +r temp; \ | ||
if diff temp LICENSES; then \ | ||
echo "Passed"; \ | ||
rm -rf temp; \ | ||
else \ | ||
echo "LICENSES directory must be updated. Run make update-licenses"; \ | ||
rm -rf temp; \ | ||
exit 1; \ | ||
fi; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters