ci: update github Worflow, and Go 1.19
This commit is contained in:
parent
13a42b37ce
commit
2e95c1427f
5 changed files with 14 additions and 71 deletions
57
.github/workflows/golangci-lint.yml
vendored
57
.github/workflows/golangci-lint.yml
vendored
|
@ -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
|
|
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
|
@ -26,32 +26,32 @@ env:
|
||||||
GOCACHE: /home/runner/work/go/pkg/build
|
GOCACHE: /home/runner/work/go/pkg/build
|
||||||
GOPATH: /home/runner/work/go
|
GOPATH: /home/runner/work/go
|
||||||
|
|
||||||
GO_VERSION: '^1.18.2'
|
GO_VERSION: '^1.19'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
########################
|
########################
|
||||||
# Format, compileation and lint check
|
# Format, compileation and lint check
|
||||||
########################
|
########################
|
||||||
golangci:
|
lint-check:
|
||||||
name: lint
|
name: Format, compilation and lint check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: git checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: setup go ${{ env.GO_VERSION }}
|
- name: setup go ${{ env.GO_VERSION }}
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '${{ env.GO_VERSION }}'
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
|
|
||||||
- name: checkout source
|
- name: run format
|
||||||
uses: actions/checkout@v2
|
run: make fmt
|
||||||
|
|
||||||
- name: compile code
|
- name: compile code
|
||||||
run: go install -v ./...
|
run: go install -v ./...
|
||||||
|
|
||||||
- name: golangci-lint
|
- name: run lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
run: make lint
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
skip-go-installation: true
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# run unit tests
|
# run unit tests
|
||||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -28,7 +28,7 @@ jobs:
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.18.2
|
go-version: 1.19
|
||||||
|
|
||||||
# Login against a Docker registry except on PR
|
# Login against a Docker registry except on PR
|
||||||
# https://github.com/docker/login-action
|
# https://github.com/docker/login-action
|
||||||
|
|
|
@ -103,7 +103,7 @@ linters:
|
||||||
# - noctx
|
# - noctx
|
||||||
# - nolintlint
|
# - nolintlint
|
||||||
# - prealloc
|
# - prealloc
|
||||||
- rowserrcheck
|
# - rowserrcheck # Disabled due to generic, see https://github.com/golangci/golangci-lint/issues/2649
|
||||||
# - revive
|
# - revive
|
||||||
# - scopelint
|
# - scopelint
|
||||||
# - staticcheck
|
# - staticcheck
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -9,8 +9,8 @@ GO_BIN := ${GOPATH}/bin
|
||||||
LINT_BIN := ${GO_BIN}/golangci-lint
|
LINT_BIN := ${GO_BIN}/golangci-lint
|
||||||
GOACC_BIN := $(GO_BIN)/go-acc
|
GOACC_BIN := $(GO_BIN)/go-acc
|
||||||
|
|
||||||
LINT_COMMIT := v1.42.1
|
LINT_COMMIT := v1.48
|
||||||
GOACC_COMMIT := v0.2.6
|
GOACC_COMMIT := v0.2.8
|
||||||
|
|
||||||
DEPGET := go install
|
DEPGET := go install
|
||||||
GOBUILD := go build -v
|
GOBUILD := go build -v
|
||||||
|
|
Loading…
Reference in a new issue