-
-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (68 loc) · 1.9 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Goul Test
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
dependency-review:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Dependency Review
uses: actions/dependency-review-action@v1
test:
name: go${{ matrix.go-version }}/ubuntu-latest
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ "1.16", "1.17", "1.18" ]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: |
sudo apt-get -qq update
sudo apt-get install -y libpcap-dev
env
go build -o goul -ldflags "-X main.buildNumber=`git rev-parse --short HEAD`" ./cmd/goul
ls -l goul
./goul -v
go test -v -cover ./...
coverage:
needs: [ test ]
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Preparing
run: |
sudo apt-get -qq update
sudo apt-get install -y libpcap-dev
env
- name: Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: go test -coverprofile=coverage.txt -covermode=atomic ./...
coverageLocations: coverage.txt:gocov
prefix: github.com/${{ github.repository }}
- name: Coveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.txt
- name: Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
files: ./coverage.txt