mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-12-18 09:08:44 +03:00
54 lines
1.4 KiB
YAML
54 lines
1.4 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: Set up stable Go version
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '1.22'
|
|
- name: Get dependencies
|
|
run: go mod tidy
|
|
- name: Lint code with golangci-lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: v1.55.2
|
|
only-new-issues: true
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.22', 'stable']
|
|
steps:
|
|
- name: Set up Go ${{ matrix.go-version }}
|
|
uses: actions/setup-go@v3
|
|
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 30s -race -cover -coverprofile=coverage.txt -covermode=atomic
|
|
- name: Coverage
|
|
run: |
|
|
go install github.com/axw/gocov/gocov@latest
|
|
gocov convert ./coverage.txt | gocov report
|
|
bash <(curl -s https://codecov.io/bash) |