-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (55 loc) · 1.5 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Go
on:
push:
tags:
- '*'
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
golangci:
strategy:
matrix:
go-version: [1.17.x]
os: [macos-latest, ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
args: --deadline=480s --skip-dirs=vendor --tests
build:
strategy:
matrix:
go-version: [ 1.17.x ]
os: [ macos-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Tests
run: make run-unit-tests
- name: Update code coverage
run: bash <(curl -s https://codecov.io/bash)
- name: Build
run: go build -v ./...
release:
needs: [golangci,build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: release
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}