-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.25 KB
/
test.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
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
name: Test and Lint
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18.x]
steps:
# Step 1 - Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Step 2 - Install Go on the runner
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
# Step 3 - Run format on ./...(.go)
- name: Format
run: make format
# Step 4 - Fail if the linter errored
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
skip-go-installation: true
skip-pkg-cache: true
args: --verbose
# Step 4 - Test Code
- name: Test
run: make test
# Step 5 - Upload to CodeCov with CODECOV_TOKEN
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
# Step 6 - Echo diff
- name: Diff
run: git diff