From 58c73d9eb0098bfc030b220c9153d4f656719135 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 13 Oct 2023 12:28:02 +0100 Subject: [PATCH] feat(deps)!: upgrade minimum Go version to 1.18 (from 1.16) (#13) --- .../.release-please-manifest.json | 0 .../release-please-config.json | 0 .github/workflows/ci.yml | 34 +++++++------------ .golangci.yml | 4 --- Makefile | 2 +- go.mod | 8 ++++- runner.go | 2 +- 7 files changed, 22 insertions(+), 28 deletions(-) rename .release-please-manifest.json => .github/.release-please-manifest.json (100%) rename release-please-config.json => .github/release-please-config.json (100%) diff --git a/.release-please-manifest.json b/.github/.release-please-manifest.json similarity index 100% rename from .release-please-manifest.json rename to .github/.release-please-manifest.json diff --git a/release-please-config.json b/.github/release-please-config.json similarity index 100% rename from release-please-config.json rename to .github/release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9aaaa4..f81eb0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,20 +10,14 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.18 cache: false - - uses: actions/cache@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-golangcilint-${{ hashFiles('**/Makefile') }} - restore-keys: | - ${{ runner.os }}-golangcilint- - - name: Lint with golangci-lint - run: make lint + version: v1.54 env: - GOLANGCILINTARGS: --out-format=github-actions + VERBOSE: "true" tidy: name: Tidy @@ -32,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.16 + go-version: 1.18 - name: Check if mods are tidy run: make check-tidy @@ -43,7 +37,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.16 + go-version: 1.18 - name: Check if generate results are up to date run: make check-generate @@ -54,7 +48,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.16 + go-version: 1.18 - name: Publish coverage uses: paambaati/codeclimate-action@v4.0.0 env: @@ -76,11 +70,10 @@ jobs: - ubuntu-latest - macos-latest go_version: - - "1.16" - - "1.17" - "1.18" - "1.19" - "1.20" + - "1.21" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -98,11 +91,10 @@ jobs: if: github.ref == 'refs/heads/main' outputs: release_created: ${{ steps.release-please.outputs.release_created }} - tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0 - version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0 - all: ${{ toJSON(steps.release-please.outputs) }} + version: ${{ steps.release-please.outputs.version }} steps: - - uses: google-github-actions/release-please-action@v3 + - uses: krystal/release-please-manifest-action@v1 id: release-please with: - command: manifest + app-id: ${{ vars.RELEASE_PLEASE_GITHUB_APP_ID }} + private-key: ${{ secrets.RELEASE_PLEASE_GITHUB_APP_PRIVATE_KEY }} diff --git a/.golangci.yml b/.golangci.yml index bee01fe..e6ae811 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,8 +24,6 @@ linters: enable: - asciicheck - bodyclose - - deadcode - - depguard - durationcheck - errcheck - errorlint @@ -58,13 +56,11 @@ linters: - rowserrcheck - sqlclosecheck - staticcheck - - structcheck - tparallel - typecheck - unconvert - unparam - unused - - varcheck - wastedassign - whitespace diff --git a/Makefile b/Makefile index 3cbb442..0b986b9 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ endef $(eval $(call tool,godoc,golang.org/x/tools/cmd/godoc@latest)) $(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest)) $(eval $(call tool,goimports,golang.org/x/tools/cmd/goimports@latest)) -$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52)) +$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54)) $(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest)) $(eval $(call tool,mockgen,github.com/golang/mock/mockgen@v1.6.0)) diff --git a/go.mod b/go.mod index 5c9512d..5235cf6 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,15 @@ module github.com/krystal/go-runner -go 1.16 +go 1.18 require ( github.com/golang/mock v1.6.0 github.com/romdo/gomockctx v0.1.0 github.com/stretchr/testify v1.7.1 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) diff --git a/runner.go b/runner.go index 2e29890..a8c40ce 100644 --- a/runner.go +++ b/runner.go @@ -14,7 +14,7 @@ import ( "os/exec" ) -//go:generate mockgen -source=$GOFILE -destination=mock/${GOFILE} +//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -source=$GOFILE -destination=mock/${GOFILE} // Runner is the interface that all runner structs implements. It makes it easy // to replace the underlying command runner with a mock for testing, or a