Skip to content

Commit

Permalink
chore(ci): bump go version and all CI actions (#28)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
clok committed Jan 11, 2024
1 parent 484107d commit b617b67
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 118 deletions.
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

0 comments on commit b617b67

Please sign in to comment.