Skip to content

Commit

Permalink
Update build/test
Browse files Browse the repository at this point in the history
* Use `make -C dir` instead of `cd dir && make`
* Cleanup uncessary working_directory in config.
* Update Go modules to latest.
* Drop support for old Go versions.
* Cleanup old Go version build tweaks.

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed Jan 7, 2022
1 parent 00591a3 commit abf03eb
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 38 deletions.
21 changes: 11 additions & 10 deletions .circleci/config.yml
Expand Up @@ -14,7 +14,6 @@ jobs:
default: true
docker:
- image: circleci/golang:<< parameters.go_version >>
working_directory: /go/src/github.com/prometheus/common
steps:
- checkout
- when:
Expand All @@ -23,7 +22,7 @@ jobs:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make test
- run: cd sigv4 && make test
- run: make -C sigv4 test
- when:
condition: << parameters.use_gomod_cache >>
steps:
Expand All @@ -40,22 +39,21 @@ jobs:
default: true
docker:
- image: circleci/golang:<< parameters.go_version >>
working_directory: /go/src/github.com/prometheus/common/assets
steps:
- checkout
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make test
- run: make -C assets test
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/save-cache:
key: v1-go<< parameters.go_version >>
- store_test_results:
path: ../test-results
path: test-results
style:
parameters:
go_version:
Expand All @@ -65,7 +63,6 @@ jobs:
default: true
docker:
- image: circleci/golang:<< parameters.go_version >>
working_directory: /go/src/github.com/prometheus/common
steps:
- checkout
- when:
Expand All @@ -74,8 +71,8 @@ jobs:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make style
- run: cd sigv4 && make style
- run: cd assets && make style
- run: make -C sigv4 style
- run: make -C assets style
- when:
condition: << parameters.use_gomod_cache >>
steps:
Expand All @@ -93,12 +90,16 @@ workflows:
name: go-<< matrix.go_version >>
matrix:
parameters:
go_version: ["1.13", "1.14", "1.15", "1.16", "1.17"]
go_version:
- "1.15"
- "1.16"
- "1.17"
- test-assets:
name: assets-go-<< matrix.go_version >>
matrix:
parameters:
go_version: ["1.17"]
go_version:
- "1.17"
- style:
name: style
go_version: "1.17"
6 changes: 1 addition & 5 deletions Makefile
Expand Up @@ -14,8 +14,4 @@
include Makefile.common

.PHONY: test
test:: deps check_license unused common-test

ifeq (,$(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(7|8|9|10)\.'))
test:: lint
endif
test:: deps check_license unused common-test lint
3 changes: 0 additions & 3 deletions config/config_test.go
Expand Up @@ -11,9 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.8
// +build go1.8

package config

import (
Expand Down
3 changes: 0 additions & 3 deletions config/http_config.go
Expand Up @@ -11,9 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.8
// +build go1.8

package config

import (
Expand Down
3 changes: 0 additions & 3 deletions config/http_config_test.go
Expand Up @@ -11,9 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.8
// +build go1.8

package config

import (
Expand Down
3 changes: 0 additions & 3 deletions config/tls_config_test.go
Expand Up @@ -11,9 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.8
// +build go1.8

package config

import (
Expand Down
8 changes: 4 additions & 4 deletions go.mod
@@ -1,17 +1,17 @@
module github.com/prometheus/common

require (
github.com/go-kit/log v0.1.0
github.com/go-kit/log v0.2.0
github.com/golang/protobuf v1.4.3
github.com/julienschmidt/httprouter v1.3.0
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
golang.org/x/net v0.0.0-20220105145211-5b0dc2dfae98
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
)

go 1.13
go 1.15
15 changes: 8 additions & 7 deletions go.sum
Expand Up @@ -64,13 +64,14 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -260,15 +261,15 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220105145211-5b0dc2dfae98 h1:+6WJMRLHlD7X7frgp7TUZ36RnQzSf9wVVTNakEp+nqY=
golang.org/x/net v0.0.0-20220105145211-5b0dc2dfae98/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down

0 comments on commit abf03eb

Please sign in to comment.