From 4640411b933a3d48ab6cc8daed97ce565f4b7f1a Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Thu, 19 Sep 2024 19:15:56 -0400 Subject: [PATCH] ci: lint --- .gitea/workflows/test.yaml | 5 +++++ Makefile | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 315917f..c894a1d 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -27,6 +27,11 @@ jobs: go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.io,direct chown -R root:root /root/.ssh + - name: Setup golangci-lint + run: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 + - name: Lint + run: make lint - name: Build run: make build - name: Test diff --git a/Makefile b/Makefile index 61e9d4a..f54d3c0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all build clean prepare-test test ci-test +.PHONY: all build clean lint prepare-test test ci-test BUILD_DIR = ./build TMP_DIR = ./tmp @@ -15,6 +15,9 @@ clean: rm -rf $(TMP_DIR)/* rm -rf *.out +lint: + golangci-lint run + prepare-test: git submodule update --init --remote