From 49360e9f09467847e081f32725924ed3e37479dd Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 31 Jan 2024 20:48:21 +0100 Subject: [PATCH] chore: update Go, CI, and linter --- .github/FUNDING.yml | 2 ++ .github/workflows/go-cross.yml | 30 ++++++------------------------ .github/workflows/main.yml | 23 +++++++---------------- .golangci.yml | 14 ++++++++------ go.mod | 2 +- 5 files changed, 24 insertions(+), 47 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index d6382ac..332808e 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,3 @@ github: ldez +ko_fi: ldez_oss +liberapay: ldez diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index 759a31f..0dd6051 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -11,37 +11,19 @@ jobs: strategy: matrix: - go-version: [ '1.20', 1.x ] + go-version: [ stable ] os: [ubuntu-latest, macos-latest, windows-latest] steps: - # https://github.com/marketplace/actions/setup-go-environment - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go-version }} - # https://github.com/marketplace/actions/checkout - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - # https://github.com/marketplace/actions/cache - - name: Cache Go modules - uses: actions/cache@v3 + # https://github.com/marketplace/actions/setup-go-environment + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - # * Build cache (Windows) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.go-version }}-go- + go-version: ${{ matrix.go-version }} - name: Test run: go test -v -cover ./... diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 148bf5b..f9c4d8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,32 +14,23 @@ jobs: name: Main Process runs-on: ubuntu-latest env: - GO_VERSION: '1.20' - GOLANGCI_LINT_VERSION: v1.52.2 + GO_VERSION: stable + GOLANGCI_LINT_VERSION: v1.55.2 CGO_ENABLED: 0 steps: - # https://github.com/marketplace/actions/setup-go-environment - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - # https://github.com/marketplace/actions/checkout - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - # https://github.com/marketplace/actions/cache - - name: Cache Go modules - uses: actions/cache@v3 + # https://github.com/marketplace/actions/setup-go-environment + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version: ${{ env.GO_VERSION }} - name: Check and get dependencies run: | diff --git a/.golangci.yml b/.golangci.yml index 46341c7..4c5b32b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,11 +29,13 @@ linters-settings: gofumpt: extra-rules: true depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/sirupsen/logrus - - github.com/pkg/errors + rules: + main: + deny: + - pkg: "github.com/instana/testify" + desc: not allowed + - pkg: "github.com/pkg/errors" + desc: Should be replaced by standard lib errors package gocritic: enabled-tags: - diagnostic @@ -98,7 +100,7 @@ linters: issues: exclude-use-default: false - max-per-linter: 0 + max-issues-per-linter: 0 max-same-issues: 0 exclude: - 'package-comments: should have a package comment' diff --git a/go.mod b/go.mod index 308cbc4..08c7502 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/ldez/go-git-cmd-wrapper/v2 -go 1.18 +go 1.19