Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into log-run-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cresh committed Jun 24, 2024
2 parents 31f612f + d1b56d0 commit 79113bb
Show file tree
Hide file tree
Showing 204 changed files with 10,627 additions and 883 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.22.4"

- name: Install APT-based build dependencies
run: >
sudo apt-get update &&
sudo apt-get install make protobuf-compiler
- name: Run static analysis
run: make check checktidy

- name: Run tests
run: make test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/3rdparty
/bin
/coverage.html
/dist/
/logstash-filter-verifier
/.vscode/
*.coverprofile
*.swp
logstash-filter-verifier.yml
12 changes: 9 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@
linters:
disable-all: true
enable:
- deadcode
- asciicheck
- bidichk
- durationcheck
- errname
- exportloopref
- gocyclo
- godot
- gofmt
- gosec
- gosimple
- ineffassign
- makezero
- misspell
- prealloc
- staticcheck
- structcheck
- tenv
- typecheck
- unconvert
- unused
- varcheck
- wastedassign
- whitespace

linters-settings:
Expand Down
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ Logstash Filter Verifier Change Log
All timestamps are in the Europe/Stockholm timezone.


1.6.2 (2020-11-21)
------------------

* Fixed race condition bug that sometimes caused the summary to not
get shown at the end of the execution.
* Upgraded the Go compiler used for release binaries and CI to 1.15.2.


1.6.1 (2020-06-30)
------------------

* Slightly changed output format with a summary included at the end.
* The `codec` test case file option is inserted in the configuration file
verbatim rather than as a string literal, allowing the user to provide
additional codec options.


1.6.0 (2020-01-02)
------------------

Expand Down
49 changes: 35 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OS_NAME := $(shell uname -s)
endif

# The Docker image to use when building release images.
GOLANG_DOCKER_IMAGE := golang:1.13.5
GOLANG_DOCKER_IMAGE := golang:1.22.4

INSTALL := install

Expand All @@ -31,17 +31,20 @@ PROGRAM := logstash-filter-verifier
# List of all GOOS_GOARCH combinations that we should build release
# binaries for. See https://golang.org/doc/install/source#environment
# for all available combinations.
TARGETS := darwin_amd64 linux_386 linux_amd64 windows_386 windows_amd64
TARGETS := darwin_amd64 linux_386 linux_amd64

VERSION := $(shell git describe --tags --always)

GOCOV := $(GOBIN)/gocov$(EXEC_SUFFIX)
GOCOV_HTML := $(GOBIN)/gocov-html$(EXEC_SUFFIX)
GOLANGCI_LINT := $(GOBIN)/golangci-lint$(EXEC_SUFFIX)
GOVVV := $(GOBIN)/govvv$(EXEC_SUFFIX)
OVERALLS := $(GOBIN)/overalls$(EXEC_SUFFIX)
GOCOV := $(GOBIN)/gocov$(EXEC_SUFFIX)
GOCOV_HTML := $(GOBIN)/gocov-html$(EXEC_SUFFIX)
GOLANGCI_LINT := $(GOBIN)/golangci-lint$(EXEC_SUFFIX)
GOVVV := $(GOBIN)/govvv$(EXEC_SUFFIX)
OVERALLS := $(GOBIN)/overalls$(EXEC_SUFFIX)
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go$(EXEC_SUFFIX)
PROTOC_GEN_GO_GRPC := $(GOBIN)/protoc-gen-go-grpc$(EXEC_SUFFIX)
MOQ := $(GOBIN)/moq$(EXEC_SUFFIX)

GOLANGCI_LINT_VERSION := v1.22.2
GOLANGCI_LINT_VERSION := v1.59.0

.PHONY: all
all: $(PROGRAM)$(EXEC_SUFFIX)
Expand All @@ -50,34 +53,52 @@ all: $(PROGRAM)$(EXEC_SUFFIX)
.FORCE:

$(GOCOV):
go get github.com/axw/gocov/gocov
go install github.com/axw/gocov/gocov

$(GOCOV_HTML):
go get github.com/matm/gocov-html
go install github.com/matm/gocov-html

$(GOLANGCI_LINT):
curl --silent --show-error --location \
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(dir $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION)

$(GOVVV):
go get github.com/ahmetb/govvv
go install github.com/ahmetb/govvv

$(OVERALLS):
go get github.com/go-playground/overalls
go install github.com/go-playground/overalls

$(PROTOC_GEN_GO):
go install google.golang.org/protobuf/cmd/protoc-gen-go

$(PROTOC_GEN_GO_GRPC):
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

$(MOQ):
go install github.com/matryer/moq

# The Go compiler is fast and pretty good about figuring out what to
# build so we don't try to to outsmart it.
$(PROGRAM)$(EXEC_SUFFIX): .FORCE $(GOVVV)
$(PROGRAM)$(EXEC_SUFFIX): gogenerate .FORCE $(GOVVV)
govvv build -o $@

.PHONY: gogenerate
gogenerate: $(MOQ) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC)
go generate ./...

.PHONY: check
check: $(GOLANGCI_LINT)
golangci-lint run

.PHONY: checktidy
checktidy:
go mod tidy && git diff --exit-code -- go.mod go.sum

.PHONY: clean
clean:
rm -f $(PROGRAM)$(EXEC_SUFFIX) $(GOCOV) $(GOCOV_HTML) $(GOLANGCI_LINT) $(GPM) $(OVERALLS)
rm -f $(PROGRAM)$(EXEC_SUFFIX)
rm -rf $(GOBIN)
rm -rf dist

.PHONY: install
Expand Down
Loading

0 comments on commit 79113bb

Please sign in to comment.