Merge pull request #295 from x1unix/chore/stale-issues #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Code coverage report | |
# | |
# Reports tests code coverage to coveralls. | |
# Uses COVERALLS_TOKEN env var from GitHub repo secrets. | |
# | |
# see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
# | |
name: Submit code coverage | |
on: | |
push: | |
branches: | |
- master | |
env: | |
GO111MODULE: on | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.21.0" | |
- uses: actions/checkout@v4 | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- run: go version | |
- name: install | |
run: | | |
go get golang.org/x/tools/cmd/cover | |
- name: Test | |
run: cat tools/cover.txt | xargs go test -v -covermode=count -coverprofile=coverage.out | |
- name: Send coverage | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: coverage.out |