diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fff9aa1..ad0facc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,6 +21,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v1 - - name: Make - run: | - make + - name: Test + run: go test ./... + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 diff --git a/Makefile b/Makefile index 24988ca..b2f3c10 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GOPATH=$(shell go env GOPATH) .PHONY: all $(GOPATH)/bin/wherewasi test lint proto -go_build_flags=-tags="libsqlite3 sqlite3_unlock_notify" +go_build_flags= all: $(GOPATH)/bin/wherewasi test lint @@ -12,8 +12,5 @@ $(GOPATH)/bin/wherewasi: test: go test $(go_build_flags) -v . -lint: bin/golangci-lint-1.23.8 - ./bin/golangci-lint-1.23.8 run ./... - -bin/golangci-lint-1.23.8: - ./hack/fetch-golangci-lint.sh +lint: + golangci-lint run ./... diff --git a/hack/fetch-golangci-lint.sh b/hack/fetch-golangci-lint.sh deleted file mode 100755 index e959ef2..0000000 --- a/hack/fetch-golangci-lint.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -golangci_lint_version="1.23.8" -golangci_lint_sha256="unknown" # set in platform block below - -goarch=amd64 # it's 2020 -goos="unknown" - -if [[ "$OSTYPE" == "linux-gnu" ]]; then - goos="linux" - golangci_lint_sha256="9c95f7860cdddff92ba7eb0d765267bb0c868e8a991100b75f4caa8818f92f96" -elif [[ "$OSTYPE" == "darwin"* ]]; then - goos="darwin" - golangci_lint_sha256="de309a84af016cc751528361bfa4403a011850ad073585f500ed463b35e66daf" -fi - -srcdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" - -if [ -f "$srcdir/bin/golangci-lint-${golangci_lint_version}" ]; then - echo "--> Already downloaded" - exit 0 -fi - -workdir=$(mktemp -d) - -function cleanup { - rm -rf "$workdir" -} -trap cleanup EXIT - -echo "--> Downloading" -curl -sLo "$workdir/download.tgz" "https://github.com/golangci/golangci-lint/releases/download/v${golangci_lint_version}/golangci-lint-${golangci_lint_version}-${goos}-${goarch}.tar.gz" - -echo "--> Unpacking" -cd "$workdir" -tar -zxf "$workdir/download.tgz" -mv golangci-lint*/golangci-lint . - -echo "--> Verifying" -echo "$golangci_lint_sha256 *golangci-lint" | shasum -a 256 -c - - -mkdir -p "$srcdir/bin" -mv golangci-lint "$srcdir/bin/golangci-lint-${golangci_lint_version}" -echo "--> Fetched bin/golangci-lint-${golangci_lint_version}"