|
|
|
@ -14,7 +14,7 @@ jobs:
|
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
- id: cache-paths
|
|
|
|
|
- id: go-env
|
|
|
|
|
run: |
|
|
|
|
|
echo "::set-output name=cache::$(go env GOCACHE)"
|
|
|
|
|
echo "::set-output name=mod-cache::$(go env GOMODCACHE)"
|
|
|
|
@ -22,10 +22,17 @@ jobs:
|
|
|
|
|
uses: actions/cache@v2
|
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
${{ steps.cache-paths.outputs.cache }}
|
|
|
|
|
${{ steps.cache-paths.outputs.mod-cache }}
|
|
|
|
|
${{ steps.go-env.outputs.cache }}
|
|
|
|
|
${{ steps.go-env.outputs.mod-cache }}
|
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
|
restore-keys: ${{ runner.os }}-go-
|
|
|
|
|
- name: Test
|
|
|
|
|
run: |
|
|
|
|
|
go test ./...
|
|
|
|
|
go test -coverprofile='coverage.out' -covermode=atomic ./...
|
|
|
|
|
- name: Upload Code Coverage
|
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
|
with:
|
|
|
|
|
fail_ci_if_error: true
|
|
|
|
|
files: coverage.out
|
|
|
|
|
flags: ${{ matrix.os }},go-${{ matrix.go-version }}
|
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|