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
2025-03-06 14:42:46 +03:00
uses: actions/checkout@v4
2021-02-09 22:21:57 +03:00
- name: Set up latest Go 1.x version
2025-03-06 14:42:46 +03:00
uses: actions/setup-go@v5
2021-02-09 22:21:57 +03:00
with:
2025-03-06 14:42:46 +03:00
go-version: '1.24'
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
2025-03-06 14:42:46 +03:00
uses: golangci/golangci-lint-action@v6
2021-02-09 22:21:57 +03:00
with:
2025-03-06 14:46:36 +03:00
version: v1.62.2
2021-02-09 22:21:57 +03:00
only-new-issues: true
2020-11-26 14:10:42 +03:00
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
2025-03-06 14:42:46 +03:00
go-version: ['1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24']
2020-11-26 14:10:42 +03:00
steps:
- name: Set up Go ${{ matrix.go-version }}
2025-03-06 14:42:46 +03:00
uses: actions/setup-go@v5
2020-11-26 14:10:42 +03:00
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
2025-03-06 14:42:46 +03:00
uses: actions/checkout@v4
2020-11-26 14:10:42 +03:00
- 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)