diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07deb7fcc..20174137a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,8 @@ jobs: set -x make install.tools + make test + make .gitvalidation make docs make -C schema test diff --git a/Makefile b/Makefile index bf058ba37..1ebe2e281 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,10 @@ endif version.md: ./specs-go/version.go go run ./.tool/version-doc.go > $@ +.PHONY: test +test: + go test ./... + .PHONY: lint lint: golangci-lint run diff --git a/RELEASES.md b/RELEASES.md index 071910aed..80b2de480 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -61,8 +61,8 @@ Releases usually follow a few steps: * [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'` * [ ] merge multi-commit PRs (so each line has a `(#num)` suffix) * [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /` - * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable - * [ ] a commit adding back the "+dev" to `VersionDev` + * [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable (update `Version` accordingly) + * [ ] a commit adding back the "+dev" to `VersionDev` and `Version` * [ ] send email to * [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev") * [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l` diff --git a/specs-go/version.go b/specs-go/version.go index 9a985a528..72d57132d 100644 --- a/specs-go/version.go +++ b/specs-go/version.go @@ -1,7 +1,5 @@ package specs -import "fmt" - const ( // VersionMajor is for an API incompatible changes VersionMajor = 1 @@ -15,4 +13,4 @@ const ( ) // Version is the specification version that the package types support. -var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) +var Version = "1.3.0+dev" diff --git a/specs-go/version_test.go b/specs-go/version_test.go new file mode 100644 index 000000000..4b8012d93 --- /dev/null +++ b/specs-go/version_test.go @@ -0,0 +1,13 @@ +package specs + +import ( + "strconv" + "testing" +) + +func TestVersionSynced(t *testing.T) { + wantVer := strconv.Itoa(VersionMajor) + "." + strconv.Itoa(VersionMinor) + "." + strconv.Itoa(VersionPatch) + VersionDev + if Version != wantVer { + t.Fatalf("Version mismatch: got %q, want %q", Version, wantVer) + } +}