From d61dd025531eda99ebfe51ffe55203485534215f Mon Sep 17 00:00:00 2001 From: Jan Delgado Date: Sun, 6 Aug 2023 14:40:51 +0200 Subject: [PATCH] fix pipeline upgrade deps, tools --- .github/workflows/test_and_build.yml | 22 +++++++++++----------- .github/workflows/upload_assets.yml | 7 +++---- go.mod | 10 ++++++++-- go.sum | 17 ++++++++++++----- main.go | 8 +++++--- pre-commit | 2 +- 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 0724b35..c5b4542 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -12,15 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: 1.16.x + go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - version: v1.39.0 + version: v1.52.2 - name: Run linters run: | export PATH=$PATH:$(go env GOPATH)/bin @@ -31,11 +31,11 @@ jobs: steps: - name: Install Go if: success() - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: 1.16.x + go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run tests run: make test - name: Convert coverage to lcov @@ -54,11 +54,11 @@ jobs: needs: [lint, test] steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: 1.16.x + go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: build run: | export GO111MODULE=on diff --git a/.github/workflows/upload_assets.yml b/.github/workflows/upload_assets.yml index d6fcde5..8be80b6 100644 --- a/.github/workflows/upload_assets.yml +++ b/.github/workflows/upload_assets.yml @@ -9,14 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: 1.13.x + go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v3 - name: build run: | - export GO111MODULE=on make build for f in bin/*; do tar cvzf $f.tar.gz $f; rm $f; done cp README.md bin/ diff --git a/go.mod b/go.mod index d62420b..0483010 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,11 @@ module github.com/jandelgado/gcov2lcov -go 1.12 +go 1.19 -require github.com/stretchr/testify v1.4.0 +require github.com/stretchr/testify v1.8.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.1 // indirect +) diff --git a/go.sum b/go.sum index e863f51..2ec90f7 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,17 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index e9d6496..98119ed 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,6 @@ // Credits: // This tool is based on covfmt (https://github.com/ricallinson/covfmt) and // uses some parts of goveralls (https://github.com/mattn/goveralls). -// package main import ( @@ -166,9 +165,12 @@ func writeLcov(blocks map[string][]*block, f io.Writer) error { } // Format being parsed is: -// name.go:line.column,line.column numberOfStatements count +// +// name.go:line.column,line.column numberOfStatements count +// // e.g. -// github.com/jandelgado/golang-ci-template/main.go:6.14,8.2 1 1 +// +// github.com/jandelgado/golang-ci-template/main.go:6.14,8.2 1 1 func parseCoverageLine(line string) (string, *block, error) { path := strings.Split(line, ":") if len(path) != 2 { diff --git a/pre-commit b/pre-commit index c79cf26..d0a0d8d 100755 --- a/pre-commit +++ b/pre-commit @@ -1,2 +1,2 @@ #!/bin/sh -golangci-lint -E bodyclose,misspell,gocyclo,dupl,gofmt,golint,unconvert,goimports,depguard,gocritic,funlen,interfacer run +golangci-lint -E bodyclose,misspell,gocyclo,dupl,gofmt,unconvert,goimports,gocritic,funlen,errcheck,gosimple,govet,ineffassign,staticcheck,typecheck,unused run