-
-
Notifications
You must be signed in to change notification settings - Fork 21
45 lines (44 loc) · 1.14 KB
/
main.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
on:
push:
branches:
- "master"
pull_request:
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: test
runs-on: ${{ matrix.os }}
steps:
- name: Setup Go 1.17.2
uses: actions/setup-go@v2
with:
go-version: 1.17.2
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Vet
run: make vet
- name: Test
run: make test
- name: Lint
if: matrix.os == 'ubuntu-latest'
run: |
go get golang.org/x/lint/golint
export PATH="$PATH:$(go env GOPATH)/bin"
make lint
env:
GO111MODULE: off
- name: Declare some variables
if: matrix.os == 'ubuntu-latest'
id: vars
run: |
echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
- name: Test Coverage (pkg)
if: matrix.os == 'ubuntu-latest'
run: go test ./... -coverprofile=${{ steps.vars.outputs.coverage_txt }}
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
files: ${{ steps.vars.outputs.coverage_txt }}