Skip to content

Commit b617b67

Browse files
authored
chore(ci): bump go version and all CI actions (#28)
* chore(ci): bump go version and all CI actions Signed-off-by: clok <github@clok.sh> * fix: broken tests Signed-off-by: clok <github@clok.sh> --------- Signed-off-by: clok <github@clok.sh>
1 parent 484107d commit b617b67

File tree

10 files changed

+136
-118
lines changed

10 files changed

+136
-118
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ on: [ push, pull_request ]
33
jobs:
44
golangci:
55
name: lint
6-
runs-on: ubuntu-latest
6+
runs-on: ubuntu-22.04
77
steps:
8-
- uses: actions/checkout@v3
8+
- uses: actions/checkout@v4
99
- name: golangci-lint
1010
uses: golangci/golangci-lint-action@v3
1111
with:
12-
version: v1.38
12+
version: v1.55

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ on:
66
- '*'
77

88
env:
9-
GO_VERSION: "1.16"
9+
GO_VERSION: "1.18"
1010

1111
jobs:
1212
goreleaser:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

2020
- name: Set up Go
21-
uses: actions/setup-go@v3
21+
uses: actions/setup-go@v5
2222
with:
2323
go-version: ${{ env.GO_VERSION }}
2424

2525
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v2
26+
uses: goreleaser/goreleaser-action@v5
2727
with:
2828
version: latest
2929
args: release --rm-dist

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@ on: [push, pull_request]
22
name: test and build
33

44
env:
5-
GO_VERSION: "1.16"
5+
GO_VERSION: "1.18"
66

77
jobs:
88
coverage:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- name: Install Go
1212
if: success()
13-
uses: actions/setup-go@v3
13+
uses: actions/setup-go@v5
1414
with:
1515
go-version: ${{ env.GO_VERSION }}
1616

1717
- name: Checkout code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Calc coverage
2121
run: |
2222
export PATH=$PATH:$(go env GOPATH)/bin
2323
go test -v -covermode=count -coverprofile=coverage.out -run ^Test_
2424
2525
- name: Convert coverage to lcov
26-
uses: jandelgado/gcov2lcov-action@v1.0.8
26+
uses: jandelgado/gcov2lcov-action@v1.0.9
2727
with:
2828
infile: coverage.out
2929
outfile: coverage.lcov
3030

3131
- name: Coveralls
32-
uses: coverallsapp/github-action@v1.1.2
32+
uses: coverallsapp/github-action@v2.2.3
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}
3535
path-to-lcov: coverage.lcov

.github/workflows/warm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111
name: Renew documentation
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Pull new module version
1515
uses: clok/go-proxy-pull-action@master

.golangci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ linters:
1919
- golint
2020
- misspell
2121
- unconvert
22+
23+
linters-settings:
24+
depguard:
25+
rules:
26+
prevent_unmaintained_packages:
27+
list-mode: lax # allow unless explicitely denied
28+
files:
29+
- $all
30+
- "!$test"
31+
allow:
32+
- $gostd
33+
- 'github.com/clok'
34+
- 'github.com/urfave/cli/v2'
35+
- 'github.com/cpuguy83/go-md2man/v2'

cdocs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"fmt"
66
"io"
7-
"io/ioutil"
87
"os"
98
"path/filepath"
109
"runtime"
@@ -114,7 +113,7 @@ func InstallManpageCommand(opts *InstallManpageCommandInput) (*cli.Command, erro
114113
mp, _ := ToMan(c.App)
115114
manpath := filepath.Join(path, fmt.Sprintf("%s.8", name))
116115
kman.Printf("generated man page path: %s", manpath)
117-
err := ioutil.WriteFile(manpath, []byte(mp), 0644)
116+
err := os.WriteFile(manpath, []byte(mp), 0644)
118117
if err != nil {
119118
return cli.Exit(fmt.Sprintf("Unable to install man page: %e", err), 2)
120119
}

cdocs_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"github.com/stretchr/testify/assert"
77
"github.com/urfave/cli/v2"
8-
"io/ioutil"
98
"os"
109
"testing"
1110
"time"
@@ -317,7 +316,7 @@ func Test_ToMarkdown(t *testing.T) {
317316

318317
res, err := ToMarkdown(app)
319318

320-
data, _ := ioutil.ReadFile("data/test.md")
319+
data, _ := os.ReadFile("data/test.md")
321320

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

331330
res, err := ToMan(app)
332331

333-
data, _ := ioutil.ReadFile("data/test.man")
332+
data, _ := os.ReadFile("data/test.man")
334333

335334
is.Nil(err)
336335
is.Equal(res, string(data))

0 commit comments

Comments
 (0)