db223ce4af
- migrate from travis to github workflow - upgrade minimum go version to 1.13 - setup golangci job Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com> Co-Authored-By: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Setup golangci-lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.41.1
|
|
args: --verbose
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO111MODULE: on
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.13, 1.14, 1.15, 1.16, 1.17]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test
|
|
run: go test -race -v -count=1 -coverprofile=coverage.out ./...
|
|
- uses: codecov/codecov-action@v2
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
flags: go-${{ matrix.go-version }}
|