Skip to content

Commit

Permalink
ci: send coverage to Coveralls; upgrade action versions
Browse files Browse the repository at this point in the history
This commit adjusts the following parts of the GitHub Actions configuration
for this repo:

* Report test coverage to Coveralls via github.com/mattn/goveralls
* Bump versions of actions/setup-go and actions/checkout to prevent "Node.js
  16 actions are deprecated" warnings
* Simplify installation command for golint
* Include coverage badge in README
  • Loading branch information
evanelias committed Jul 3, 2024
1 parent 7acc57b commit 5832aa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{env.GOVERSION}}

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run gofmt
run: test -z "$(gofmt -s -d *.go 2>&1)"

- name: Run golint
run: go get golang.org/x/lint/golint && go install golang.org/x/lint/golint && golint -set_exit_status
run: go install golang.org/x/lint/golint@latest && golint -set_exit_status

- name: Run go vet
run: go vet

- name: Run tests
run: go test -v -coverprofile=coverage.out -covermode=count

- name: Report coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: go install github.com/mattn/goveralls@latest && goveralls -coverprofile=coverage.out -service=github
continue-on-error: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# knownhosts: enhanced Golang SSH known_hosts management

[![build status](https://img.shields.io/github/actions/workflow/status/skeema/knownhosts/tests.yml?branch=main)](https://github.com/skeema/knownhosts/actions)
[![code coverage](https://img.shields.io/coveralls/skeema/knownhosts.svg)](https://coveralls.io/r/skeema/knownhosts)
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/skeema/knownhosts)


Expand Down

0 comments on commit 5832aa8

Please sign in to comment.