Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): bump go version and all CI actions #28

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ on: [ push, pull_request ]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.38
version: v1.55
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ on:
- '*'

env:
GO_VERSION: "1.16"
GO_VERSION: "1.18"

jobs:
goreleaser:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ on: [push, pull_request]
name: test and build

env:
GO_VERSION: "1.16"
GO_VERSION: "1.18"

jobs:
coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Calc coverage
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go test -v -covermode=count -coverprofile=coverage.out -run ^Test_

- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.0.8
uses: jandelgado/gcov2lcov-action@v1.0.9
with:
infile: coverage.out
outfile: coverage.lcov

- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
2 changes: 1 addition & 1 deletion .github/workflows/warm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:
name: Renew documentation
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Pull new module version
uses: clok/go-proxy-pull-action@master
14 changes: 14 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ linters:
- golint
- misspell
- unconvert

linters-settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax # allow unless explicitely denied
files:
- $all
- "!$test"
allow:
- $gostd
- 'github.com/clok'
- 'github.com/urfave/cli/v2'
- 'github.com/cpuguy83/go-md2man/v2'
3 changes: 1 addition & 2 deletions cdocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -114,7 +113,7 @@ func InstallManpageCommand(opts *InstallManpageCommandInput) (*cli.Command, erro
mp, _ := ToMan(c.App)
manpath := filepath.Join(path, fmt.Sprintf("%s.8", name))
kman.Printf("generated man page path: %s", manpath)
err := ioutil.WriteFile(manpath, []byte(mp), 0644)
err := os.WriteFile(manpath, []byte(mp), 0644)
if err != nil {
return cli.Exit(fmt.Sprintf("Unable to install man page: %e", err), 2)
}
Expand Down
5 changes: 2 additions & 3 deletions cdocs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
"io/ioutil"
"os"
"testing"
"time"
Expand Down Expand Up @@ -317,7 +316,7 @@ func Test_ToMarkdown(t *testing.T) {

res, err := ToMarkdown(app)

data, _ := ioutil.ReadFile("data/test.md")
data, _ := os.ReadFile("data/test.md")

is.Nil(err)
is.Equal(res, string(data))
Expand All @@ -330,7 +329,7 @@ func Test_ToMan(t *testing.T) {

res, err := ToMan(app)

data, _ := ioutil.ReadFile("data/test.man")
data, _ := os.ReadFile("data/test.man")

is.Nil(err)
is.Equal(res, string(data))
Expand Down
Loading
Loading