2019-11-01 21:18:03 -05:00
|
|
|
on: [push, pull_request]
|
|
|
|
name: tests
|
|
|
|
env:
|
|
|
|
GO111MODULE: on
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-11 17:05:51 -05:00
|
|
|
go-version:
|
|
|
|
# support the two most recent major go versions
|
|
|
|
- 1.x
|
|
|
|
- 1.14.x
|
2020-01-26 14:56:40 -05:00
|
|
|
platform: [ubuntu-latest, windows-latest]
|
2021-02-11 17:05:51 -05:00
|
|
|
include:
|
|
|
|
# minimum go version that works. This is not necessarily supported in
|
|
|
|
# any way, and will be bumped up without notice as needed. But it at
|
|
|
|
# least lets us know what go version should work.
|
|
|
|
- go-version: 1.11
|
|
|
|
platform: ubuntu-latest
|
2019-11-01 21:18:03 -05:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
steps:
|
2021-02-11 17:05:51 -05:00
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- uses: actions/checkout@v2
|
2019-11-01 21:18:03 -05:00
|
|
|
|
2021-02-11 17:05:51 -05:00
|
|
|
- name: Cache go modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
|
|
|
|
restore-keys: ${{ runner.os }}-go-
|
2019-11-01 21:18:03 -05:00
|
|
|
|
2021-02-11 17:05:51 -05:00
|
|
|
- name: Run go test
|
|
|
|
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./...
|
2019-11-01 21:18:03 -05:00
|
|
|
|
2021-02-11 17:05:51 -05:00
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
timeout-minutes: 2
|