2020-04-26 06:11:35 +03:00
|
|
|
name: Go
|
2020-10-06 19:53:36 +03:00
|
|
|
on: [push, pull_request]
|
2020-04-26 06:11:35 +03:00
|
|
|
jobs:
|
2020-12-30 12:06:43 +03:00
|
|
|
test:
|
2020-04-26 06:11:35 +03:00
|
|
|
name: Test
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-01-10 09:11:52 +03:00
|
|
|
os: [ "ubuntu-latest", "macos-latest" ]
|
2020-10-06 19:53:58 +03:00
|
|
|
go-version: [ "1.13", "1.14", "1.15" ]
|
2020-04-26 06:11:35 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2020-12-30 13:32:38 +03:00
|
|
|
- name: setup Go ${{ matrix.go-version }}
|
2020-10-06 19:49:58 +03:00
|
|
|
uses: actions/setup-go@v2
|
2020-04-26 06:11:35 +03:00
|
|
|
with:
|
2020-10-06 19:53:58 +03:00
|
|
|
go-version: ${{ matrix.go-version }}
|
2020-12-30 13:32:38 +03:00
|
|
|
- name: checkout
|
2020-04-26 06:11:35 +03:00
|
|
|
uses: actions/checkout@v2
|
2021-01-10 19:03:30 +03:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
~/Library/Caches/go-build
|
|
|
|
'%LocalAppData%\go-build'
|
2021-01-10 19:08:12 +03:00
|
|
|
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
|
2021-01-10 19:03:30 +03:00
|
|
|
restore-keys: |
|
2021-01-10 19:08:12 +03:00
|
|
|
${{ matrix.os }}-go-
|
2020-12-30 13:32:38 +03:00
|
|
|
- name: simple test
|
2020-12-30 12:06:43 +03:00
|
|
|
run: go test -v ./ -count=1
|
2020-12-30 13:32:38 +03:00
|
|
|
- name: test with GC pressure
|
|
|
|
run: go test -v ./ -count=1
|
|
|
|
env:
|
|
|
|
GOGC: 1
|
|
|
|
- name: test with race detector
|
|
|
|
run: go test -v -race ./ -count=1
|
2020-12-30 12:06:43 +03:00
|
|
|
coverage:
|
|
|
|
name: Coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: setup Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.15
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: measure coverage
|
|
|
|
run: go test -v -coverprofile=coverage.out ./ -count=1
|
|
|
|
- name: report coverage
|
|
|
|
run: |
|
|
|
|
bash <(curl -s https://codecov.io/bash)
|