-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (56 loc) · 1.54 KB
/
go.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
60
61
62
63
64
name: Unit-Tests
on:
pull_request:
paths:
- 'go.mod'
- '**.go'
- '**.yml'
push:
paths:
- '**.go'
- 'go.mod'
- '**.yml'
# https://github.com/actions
jobs:
test:
name: Test on go ${{ matrix.go_version }}
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [1.19, '1.20', 1.21]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Display Env
run: |
git remote -v
git tag -l
env
- name: Setup Go Faster
uses: WillAbides/[email protected]
timeout-minutes: 3
with:
go-version: ${{ matrix.go_version }}
- name: Revive check
uses: docker://morphy/revive-action:v2.3.1
with:
# Exclude patterns, separated by semicolons (optional)
exclude: "./internal/..."
- name: Run static check
uses: reviewdog/action-staticcheck@v1
if: ${{ github.event_name == 'pull_request'}}
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-check
# Report all results. [added,diff_context,file,nofilter].
filter_mode: added
# Exit with 1 when it find at least one finding.
fail_on_error: true
- name: Run tests
run: |
pwd
go test -v -cover ./...
# go run ./cmd/chlog last head