Skip to content

Commit

Permalink
Merge pull request #481 from google/fix-ci
Browse files Browse the repository at this point in the history
Repair CI errors with go 1.16.
  • Loading branch information
jaqx0r authored Mar 13, 2021
2 parents 23a0f62 + 2d5687a commit 1cb28a9
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- master
- main
pull_request:
schedule:
- cron: 25 1 * * 1
env:
GOPROXY: "https://proxy.golang.org"
jobs:
Expand All @@ -30,7 +32,7 @@ jobs:
${{ runner.os }}-go-
- name: install deps
if: steps.cache.output.cache-hit != 'true'
run: make --debug install_deps
run: go mod download
- name: build
run: make --debug all
- name: test
Expand Down
35 changes: 13 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export GO111MODULE ?= on
# Build these.
TARGETS = mtail mgen mdot mfmt

GO_TEST_FLAGS ?=
GO_TEST_FLAGS ?=
BENCH_COUNT ?= 1
BASE_REF ?= master
HEAD_REF ?= $(shell git symbolic-ref HEAD -q --short | tr / - 2>/dev/null)
Expand Down Expand Up @@ -40,12 +40,6 @@ endif
# all benchmarks, not per bench.
benchtimeout := 120m

# Be verbose with `go get`, if UPDATE is y then also update dependencies.
GOGETFLAGS = -v
ifeq ($(UPDATE),y)
GOGETFLAGS += -u
endif

GOFILES=$(shell find . -name '*.go' -a ! -name '*_test.go')

GOTESTFILES=$(shell find . -name '*_test.go')
Expand All @@ -61,32 +55,32 @@ CLEANFILES+=\
internal/mtail/logo.ico\

# A place to install tool dependencies.
GOBIN ?= $(firstword $(subst :, ,$(GOPATH)))/bin
GOBIN ?= $(firstword $(subst :, ,$(shell go env GOPATH)))/bin
export PATH := $(GOBIN):$(PATH)

TOGO = $(GOBIN)/togo
$(TOGO):
go get $(GOGETFLAGS) github.com/flazz/togo
go install github.com/flazz/togo@latest

GOYACC = $(GOBIN)/goyacc
$(GOYACC):
go get $(GOGETFLAGS) golang.org/x/tools/cmd/goyacc
go install golang.org/x/tools/cmd/goyacc@latest

GOFUZZBUILD = $(GOBIN)/go114-fuzz-build
$(GOFUZZBUILD):
go get $(GOGETFLAGS) github.com/mdempsky/go114-fuzz-build
go install github.com/mdempsky/go114-fuzz-build@latest

GOFUZZ = $(GOBIN)/go-fuzz
$(GOFUZZ):
go get $(GOGETFLAGS) github.com/dvyukov/go-fuzz/go-fuzz
go install github.com/dvyukov/go-fuzz/go-fuzz@latest

GOTESTSUM = $(GOBIN)/gotestsum
$(GOTESTSUM):
go get $(GOGETFLAGS) gotest.tools/gotestsum
go install gotest.tools/gotestsum@latest

BENCHSTAT = $(GOBIN)/benchstat
$(BENCHSTAT):
go get $(GOGETFLAGS) golang.org/x/perf/cmd/benchstat
go install golang.org/x/perf/cmd/benchstat@latest


.PHONY: clean covclean crossclean depclean veryclean
Expand Down Expand Up @@ -146,7 +140,9 @@ internal/mtail/logo.ico.go: | internal/mtail/logo.ico $(TOGO)
#
.PHONY: print-version
print-version:
@go version
which go
go version
go env

###
## Install rules
Expand Down Expand Up @@ -214,11 +210,6 @@ container: Dockerfile
--build-arg build_date=$(shell date -Iseconds --utc) \
.

# Append the bin subdirs of every element of the GOPATH list to PATH, so we can find goyacc.
empty :=
space := $(empty) $(empty)
export PATH := $(PATH):$(subst $(space),:,$(patsubst %,%/bin,$(subst :, ,$(GOPATH))))

###
## Fuzz testing
#
Expand Down Expand Up @@ -270,7 +261,7 @@ fuzz-min: $(OUT)/vm-fuzzer $(OUT)/vm-fuzzer.dict
#
.PHONY: install_deps
install_deps: .dep-stamp
.dep-stamp: | $(GOGENFILES) print-version
.dep-stamp: | print-version $(GOGENFILES)
go mod download
touch $@

Expand All @@ -296,7 +287,7 @@ covrep: coverage.html
#
GHI = $(GOBIN)/ghi
$(GHI):
go get $(GOGETFLAGS) github.com/markbates/ghi
go install github.com/markbates/ghi@latest

issue-fetch: | $(GHI)
ghi fetch
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
module github.com/google/mtail

go 1.14
go 1.16

require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
github.com/flazz/togo v0.0.0-20170320145504-babdbf21cff0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/google/go-cmp v0.5.4
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/common v0.17.0
go.opencensus.io v0.23.0
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
golang.org/x/tools v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)
Loading

0 comments on commit 1cb28a9

Please sign in to comment.