mg-bot-api-client-go/.github/workflows/ci.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

2020-11-26 14:10:42 +03:00
name: ci
on:
push:
branches:
- '**'
tags-ignore:
- '*.*'
pull_request:
env:
MG_DEBUG: false
DEVELOPER_NODE: 1
jobs:
2021-02-09 22:21:57 +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: Set up latest Go 1.x version
uses: actions/setup-go@v2
with:
2022-04-11 12:18:04 +03:00
go-version: '1.17'
2021-02-09 22:21:57 +03:00
- name: Get dependencies
run: |
2021-06-11 14:33:44 +03:00
go mod tidy
2021-02-09 22:21:57 +03:00
cp .env.dist .env
- name: Lint code with golangci-lint
2022-04-11 12:18:04 +03:00
uses: golangci/golangci-lint-action@v3
2021-02-09 22:21:57 +03:00
with:
version: v1.36
only-new-issues: true
2020-11-26 14:10:42 +03:00
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
2021-06-11 14:33:44 +03:00
go-version: ['1.13', '1.14', '1.15', '1.16']
2020-11-26 14:10:42 +03:00
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: |
2021-06-11 14:33:44 +03:00
go mod tidy
2020-11-26 14:10:42 +03:00
cp .env.dist .env
- name: Tests
run: go test -v ./... -cover -coverprofile=coverage.txt -covermode=atomic
- name: Coverage
run: bash <(curl -s https://codecov.io/bash)