mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 05:06:04 +03:00
Neur0toxine
d15ed7ffec
* lint stage for a workflow * golangci-lint config * lint only new code or last commit * run lint only for pull requests
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags-ignore:
|
|
- '*.*'
|
|
pull_request:
|
|
|
|
env:
|
|
GO111MODULE: on
|
|
|
|
jobs:
|
|
golangci:
|
|
name: lint
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Lint code with golangci-lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.36
|
|
only-new-issues: true
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.12', '1.13', '1.14', '1.15']
|
|
steps:
|
|
- name: Set up Go ${{ matrix.go-version }}
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Get dependencies
|
|
run: go mod tidy
|
|
- name: Tests
|
|
run: go test ./... -v -cpu 2 -timeout 10s -race -cover -coverprofile=coverage.txt -covermode=atomic
|
|
- name: Coverage
|
|
run: |
|
|
go get -v -u github.com/axw/gocov/gocov
|
|
gocov convert ./coverage.txt | gocov report
|
|
bash <(curl -s https://codecov.io/bash) |