1
0
mirror of synced 2024-11-22 04:56:06 +03:00
mg-transport-api-client-go/.github/workflows/ci.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

2020-11-26 13:28:15 +03:00
name: ci
on:
push:
branches:
- '**'
tags-ignore:
- '*.*'
pull_request:
env:
GO111MODULE: on
2020-11-26 13:36:54 +03:00
MG_URL: ${{ secrets.MG_URL }}
MG_TOKEN: ${{ secrets.MG_TOKEN }}
MG_CHANNEL: ${{ secrets.MG_CHANNEL }}
2020-11-26 13:28:15 +03:00
jobs:
2021-02-09 16:04:18 +03:00
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
2020-11-26 13:28:15 +03:00
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
2020-11-26 14:24:45 +03:00
max-parallel: 1
2020-11-26 13:28:15 +03:00
matrix:
go-version: ['1.11', '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 2m -race -cover -coverprofile=coverage.txt -covermode=atomic
- name: Coverage
run: bash <(curl -s https://codecov.io/bash)