-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phillip Miller
committed
Dec 29, 2021
1 parent
c32060b
commit ca9f2ce
Showing
5 changed files
with
93 additions
and
103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Codecov | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
coverage-reporter: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Go | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=gobuild::$(go env GOCACHE)" | ||
echo "::set-output name=gomod::$(go env GOMODCACHE)" | ||
# Cache go build cache | ||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.gobuild }} | ||
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }} | ||
|
||
# Cache go mod cache | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.gomod }} | ||
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }} | ||
|
||
# Remove apt repos that are known to break from time to time | ||
# See https://github.com/actions/virtual-environments/issues/323 | ||
- name: Remove broken apt repos [Ubuntu] | ||
run: | | ||
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | ||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04' | ||
|
||
# Run build of the application | ||
- name: Run build | ||
run: | | ||
make -f MakeFile build | ||
# Run Tests and Coverage | ||
- name: Run coverage | ||
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic | ||
|
||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.txt | ||
env_vars: OS,GOVERSION | ||
verbose: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ bin/* | |
*.html | ||
*.xml | ||
coverage/* | ||
coverage.txt |
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