-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (52 loc) · 1.95 KB
/
go.yml
File metadata and controls
56 lines (52 loc) · 1.95 KB
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: Tests
on:
push:
branches: [ main develop]
pull_request:
branches: [ main ]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt update -y -qq && sudo apt install -y -qq libsnmp-dev gcc libc-dev
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v3
- name: WriteGoList
run: go list -json -m all > go.list
- name: nancy
uses: sonatype-nexus-community/nancy-github-action@main
with:
nancyCommand: sleuth --exclude-vulnerability CVE-2020-15114,CVE-2020-15136,CVE-2020-15115,CVE-2020-26160,CVE-2022-29153,CVE-2022-24687,sonatype-2019-0890,sonatype-2019-0702,CVE-2021-41803
- name: Unit Tests
run: |
go test -race -cover -coverprofile=coverage.txt -covermode=atomic -cpu 1,2 -bench . -benchmem > test.log
cat test.log
- name: Failed Logs
if: failure()
run: |
cat test.log
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
# Publish benchmarks for the master branch only
- name: Store Benchmark Result
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: rhysd/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: "go"
# Where the output from the benchmark tool is stored
output-file-path: test.log
# Push and deploy GitHub pages branch automatically
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Updating go report card for master branch only
- name: GoReportCard
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: curl --fail --request POST "https://goreportcard.com/checks" --data "repo=github.com/timdrysdale/relay"