decrr/.github/workflows/ci.yml

40 lines
866 B
YAML

name: CI
on: [push, pull_request]
jobs:
build-test:
name: Build test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build .
coverage:
name: Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Run coverage
run: go test -v -race -coverprofile=coverage.out -covermode=atomic -failfast ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1