From 2fc0a41f2433aba1ea1e91e712c59053ed6a0622 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 1 Apr 2021 14:18:43 +0000 Subject: [PATCH] add .github/workflows/go-check.yml --- .github/workflows/go-check.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/go-check.yml diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml new file mode 100644 index 0000000..a7db382 --- /dev/null +++ b/.github/workflows/go-check.yml @@ -0,0 +1,32 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + +on: [push, pull_request] + +jobs: + unit: + runs-on: ubuntu-latest + name: Go checks + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: "1.16.x" + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@be534f007836a777104a15f2456cd1fffd3ddee8 # v2020.2.2 + - name: Check that go.mod is tidy + run: | + cp go.mod go.mod.orig + cp go.sum go.sum.orig + go mod tidy + diff go.mod go.mod.orig + diff go.sum go.sum.orig + - name: go vet + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: go vet ./... + - name: staticcheck + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: | + set -o pipefail + staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g' +