|
@@ -7,10 +7,13 @@ on:
|
|
paths:
|
|
paths:
|
|
- '**.go'
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.mod'
|
|
|
|
+ - '.golangci.yml'
|
|
|
|
+ - '.github/workflows/go.yml'
|
|
pull_request:
|
|
pull_request:
|
|
paths:
|
|
paths:
|
|
- '**.go'
|
|
- '**.go'
|
|
- 'go.mod'
|
|
- 'go.mod'
|
|
|
|
+ - '.golangci.yml'
|
|
- '.github/workflows/go.yml'
|
|
- '.github/workflows/go.yml'
|
|
env:
|
|
env:
|
|
GOPROXY: "https://proxy.golang.org"
|
|
GOPROXY: "https://proxy.golang.org"
|
|
@@ -22,31 +25,25 @@ jobs:
|
|
steps:
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/checkout@v2
|
|
- name: Run golangci-lint
|
|
- name: Run golangci-lint
|
|
- uses: actions-contrib/golangci-lint@v1
|
|
|
|
|
|
+ uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
with:
|
|
- args: 'run --timeout=30m'
|
|
|
|
|
|
+ version: latest
|
|
|
|
+ args: --timeout=30m
|
|
|
|
|
|
test:
|
|
test:
|
|
name: Test
|
|
name: Test
|
|
strategy:
|
|
strategy:
|
|
matrix:
|
|
matrix:
|
|
- go-version: [1.14.x, 1.15.x]
|
|
|
|
|
|
+ go-version: [1.14.x, 1.15.x, 1.16.x]
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.platform }}
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
steps:
|
|
- name: Install Go
|
|
- name: Install Go
|
|
- uses: actions/setup-go@v1
|
|
|
|
|
|
+ uses: actions/setup-go@v2
|
|
with:
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
go-version: ${{ matrix.go-version }}
|
|
- name: Checkout code
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
uses: actions/checkout@v2
|
|
- - name: Run unit tests
|
|
|
|
- run: go test -v -race -coverprofile=coverage -covermode=atomic ./...
|
|
|
|
- - name: Upload coverage report to Codecov
|
|
|
|
- uses: codecov/codecov-action@v1.0.6
|
|
|
|
- with:
|
|
|
|
- file: ./coverage
|
|
|
|
- flags: unittests
|
|
|
|
- name: Cache downloaded modules
|
|
- name: Cache downloaded modules
|
|
uses: actions/cache@v1
|
|
uses: actions/cache@v1
|
|
with:
|
|
with:
|
|
@@ -54,4 +51,11 @@ jobs:
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
${{ runner.os }}-go-
|
|
|
|
+ - name: Run unit tests
|
|
|
|
+ run: go test -v -race -coverprofile=coverage -covermode=atomic ./...
|
|
|
|
+ - name: Upload coverage report to Codecov
|
|
|
|
+ uses: codecov/codecov-action@v1.5.0
|
|
|
|
+ with:
|
|
|
|
+ file: ./coverage
|
|
|
|
+ flags: unittests
|
|
|
|
|