From bdb7d4c53122faa5f6978648e4863e018689e2f4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Feb 2021 13:37:10 +0100 Subject: [PATCH 1/2] go.mod: update golang.org/x/sys to fix openbsd/mips64 on Go 1.16 This should hopefully fix cross-compile on openbsd/mips64 on Go 1.16 Building for GOOS=openbsd GOARCH=mips64 # golang.org/x/sys/unix Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/fcntl.go:26:42: undefined: Flock_t Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/ioctl.go:26:47: undefined: Winsize Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/ioctl.go:37:47: undefined: Termios Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/ioctl.go:55:42: undefined: Winsize Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/ioctl.go:61:42: undefined: Termios Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_openbsd.go:34:6: missing function body Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_unix_gc.go:12:6: missing function body Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_unix_gc.go:13:6: missing function body Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_unix_gc.go:14:6: missing function body Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_unix_gc.go:15:6: missing function body Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/ioctl.go:61:42: too many errors Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b3919d5..22d1e54 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 + golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b ) go 1.13 diff --git a/go.sum b/go.sum index 694c18b..45df81b 100644 --- a/go.sum +++ b/go.sum @@ -4,5 +4,5 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b h1:lAZ0/chPUDWwjqosYR0X4M490zQhMsiJ4K3DbA7o+3g= +golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From cbd14ede4ded05514a6319aaa64d905cdf6072e3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Feb 2021 13:26:21 +0100 Subject: [PATCH 2/2] CI: use GitHub Actions Use GitHub actions to run golang-ci-lint, cross, and test. The "Test()" target in Mage was a plain "go test -v ./...", and should be portable to other CI systems if needed; running it through the mage file effectively resulted in "compile a go binary to run go". The "Lint()" target in Mage relied on Travis CI setting up Golang-CI lint before it was executed, which required bash. Moving it to GitHub actions also allowed it to be run on Windows. Golang CI can still be run locally either through the mage file (which is kept for now), or running `golangci-lint run ./...` after installing golangci-lint. The "CrossBuild() Mage target is still used to perform cross-compile, as it contains code to generate the GOOS/GOARCH matrix, which makes it easier to run locally. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yaml | 61 +++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..7b5c478 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,61 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + + lint: + name: Golang-CI Lint + timeout-minutes: 10 + strategy: + matrix: + platform: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + - uses: golangci/golangci-lint-action@v2 + with: + # must be specified without patch version + version: v1.36 + cross: + name: Cross + timeout-minutes: 10 + strategy: + matrix: + go-version: [1.16.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Cross + working-directory: ci + run: go run mage.go -v -w ../ crossBuild + + test: + name: Unit test + timeout-minutes: 10 + strategy: + matrix: + go-version: [1.14.x, 1.15.x, 1.16.x] + platform: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: go test -race -v ./... diff --git a/README.md b/README.md index 5152b6a..b93d566 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) +# Logrus :walrus: [![Build Status](https://github.com/sirupsen/logrus/workflows/CI/badge.svg)](https://github.com/sirupsen/logrus/actions?query=workflow%3ACI) [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger.