From c7b02eea91eebeb56d98c6347be6dc6f4d7990e0 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 4 Jan 2024 13:44:42 +0900 Subject: [PATCH 1/3] ci: run lint and test for pull requests on GitHub Actions --- .github/workflows/test.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..fafd041 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,13 @@ +--- +name: test +on: pull_request +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - uses: actions/setup-go@v5.0.0 + with: + go-version: '1.21.5' + - run: make lint + - run: make vet From ace71f0bfc14a40b5bf53fe318fc395cea473534 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 4 Jan 2024 13:49:36 +0900 Subject: [PATCH 2/3] chore: update golangci-lint to v1.55.2 To resolve the error. ```console $ make lint ./bin/golangci-lint run --enable=goimports --disable=unused --exclude=S1023,"Error return value" ./tests/... ../../../../../.local/share/aquaproj-aqua/pkgs/http/golang.org/dl/go1.21.5.darwin-arm64.tar.gz/go/src/net/http/internal/chunked.go:79:14: undefined: max (typecheck) cr.excess = max(cr.excess, 0) ``` --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b3fe2a3..dbdabfe 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ install: go install ./cmd/minimock ./bin/golangci-lint: ./bin - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.51.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.55.2 ./bin/goreleaser: ./bin go install -modfile tools/go.mod github.com/goreleaser/goreleaser From 87c20151e354d5612de0c573ad77d3fff5c4d15b Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 4 Jan 2024 13:51:17 +0900 Subject: [PATCH 3/3] ci: fix a make target --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fafd041..d574fdc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,4 +10,4 @@ jobs: with: go-version: '1.21.5' - run: make lint - - run: make vet + - run: make test