2021-02-19 15:26:21 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
2021-04-22 17:02:51 +03:00
|
|
|
test_docker:
|
|
|
|
name: testing stuffs
|
2021-04-22 17:08:47 +03:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-22 17:02:51 +03:00
|
|
|
container: golang:1.16
|
2021-04-22 17:05:14 +03:00
|
|
|
steps:
|
|
|
|
- name: do something from docker
|
|
|
|
run: go version
|
2021-02-19 15:26:21 +03:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Golang-CI Lint
|
|
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
|
|
|
# must be specified without patch version
|
|
|
|
version: v1.36
|
|
|
|
cross:
|
|
|
|
name: Cross
|
|
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
go-version: [1.16.x]
|
|
|
|
platform: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cross
|
|
|
|
working-directory: ci
|
|
|
|
run: go run mage.go -v -w ../ crossBuild
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Unit test
|
|
|
|
timeout-minutes: 10
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
go-version: [1.14.x, 1.15.x, 1.16.x]
|
|
|
|
platform: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Test
|
|
|
|
run: go test -race -v ./...
|