From 9e7e6b68eac6705a2ebe07dbfea354bc1ec60a09 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira da Silva Date: Thu, 7 May 2020 16:57:28 -0300 Subject: [PATCH] Run golangci-lint as part of pull request workflow #604 Resolves #604 --- .github/workflows/go.yml | 27 +++++++++++++++++++++++++++ .github/workflows/lint.yml | 15 +++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/go.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 000000000..716a4be27 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,27 @@ +name: Go + +on: [push, pull_request] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: go mod verify + + - name: Build + run: + go test ./... + go build -v . diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..0f4cf2c47 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,15 @@ +name: Lint +on: [push, pull_request] +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v0.1.7 + with: + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.26 + github-token: "${{ secrets.GITHUB_TOKEN }}"