From 2e95c1427ffa5d5b87daa99ee7ec0dfe9fac5702 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Thu, 4 Aug 2022 21:17:00 -0700 Subject: [PATCH] ci: update github Worflow, and Go 1.19 --- .github/workflows/golangci-lint.yml | 57 ----------------------------- .github/workflows/main.yml | 20 +++++----- .github/workflows/release.yml | 2 +- .golangci.yml | 2 +- Makefile | 4 +- 5 files changed, 14 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 1d58c31..0000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: golangci-lint - -env: - # go needs absolute directories, using the $HOME variable doesn't work here. - GOCACHE: /home/runner/work/go/pkg/build - GOPATH: /home/runner/work/go - GO_VERSION: '^1.18.2' - -on: - push: - tags: - - v* - branches: - - "*" - pull_request: - branches: - - "*" - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - name: setup go ${{ env.GO_VERSION }} - uses: actions/setup-go@v2 - with: - go-version: '${{ env.GO_VERSION }}' - - - name: checkout source - uses: actions/checkout@v2 - - - name: compile code - run: go install -v ./... - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest - - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the action will use pre-installed Go. - skip-go-installation: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - # skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8113501..94320b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,32 +26,32 @@ env: GOCACHE: /home/runner/work/go/pkg/build GOPATH: /home/runner/work/go - GO_VERSION: '^1.18.2' + GO_VERSION: '^1.19' jobs: ######################## # Format, compileation and lint check ######################## - golangci: - name: lint + lint-check: + name: Format, compilation and lint check runs-on: ubuntu-latest steps: + - name: git checkout + uses: actions/checkout@v2 + - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v2 with: go-version: '${{ env.GO_VERSION }}' - - name: checkout source - uses: actions/checkout@v2 + - name: run format + run: make fmt - name: compile code run: go install -v ./... - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: latest - skip-go-installation: true + - name: run lint + run: make lint ######################## # run unit tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be48165..cade53b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.18.2 + go-version: 1.19 # Login against a Docker registry except on PR # https://github.com/docker/login-action diff --git a/.golangci.yml b/.golangci.yml index a32e626..371b543 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -103,7 +103,7 @@ linters: # - noctx # - nolintlint # - prealloc - - rowserrcheck + # - rowserrcheck # Disabled due to generic, see https://github.com/golangci/golangci-lint/issues/2649 # - revive # - scopelint # - staticcheck diff --git a/Makefile b/Makefile index 8ff84ca..df23970 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ GO_BIN := ${GOPATH}/bin LINT_BIN := ${GO_BIN}/golangci-lint GOACC_BIN := $(GO_BIN)/go-acc -LINT_COMMIT := v1.42.1 -GOACC_COMMIT := v0.2.6 +LINT_COMMIT := v1.48 +GOACC_COMMIT := v0.2.8 DEPGET := go install GOBUILD := go build -v