2020-06-19 15:07:58 -04:00
|
|
|
name: Coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-08-24 04:09:51 -04:00
|
|
|
branches: [master]
|
2020-08-24 09:22:27 -04:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2020-06-19 15:07:58 -04:00
|
|
|
|
|
|
|
jobs:
|
2020-08-24 04:09:51 -04:00
|
|
|
coverage:
|
2020-06-19 15:07:58 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2020-09-09 06:19:49 -04:00
|
|
|
go-version: ^1.15
|
2020-06-19 15:07:58 -04:00
|
|
|
|
2020-08-30 11:55:00 -04:00
|
|
|
- name: Checkout codebase
|
2020-06-19 15:07:58 -04:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-08-30 11:55:00 -04:00
|
|
|
- name: Cache go module
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache-gomodules
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2020-06-19 15:07:58 -04:00
|
|
|
- name: Get dependencies
|
2020-08-30 11:55:00 -04:00
|
|
|
if: steps.cache-gomodules.outputs.cache-hit != 'true'
|
2020-06-19 15:07:58 -04:00
|
|
|
run: |
|
|
|
|
go get -v -t -d ./...
|
|
|
|
|
2020-08-24 04:09:51 -04:00
|
|
|
- name: Run coverage
|
2020-06-19 15:07:58 -04:00
|
|
|
run: ./testing/coverage/coverall2
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
file: ./coverage.txt
|
|
|
|
fail_ci_if_error: true
|