This repository was archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 1.49 KB
/
go.yml
File metadata and controls
56 lines (53 loc) · 1.49 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: Go
on:
push:
paths-ignore:
- "docs/**"
env:
IMAGE_NAME: code42software/axiomatic
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.18.0
- name: Check out Source Code
uses: actions/checkout@v3
- name: Set CICD Cache Paths
id: cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Setup CICD Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
path: |
${{ steps.cache-paths.outputs.go-build }}
${{ steps.cache-paths.outputs.go-mod }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Format
run: go fmt .
- name: Lint
run: |
go install golang.org/x/lint/golint@latest
golint -set_exit_status ./...
- name: Errcheck
run: |
go install github.com/kisielk/errcheck@latest
errcheck ./...
- name: Test
run: |
go test ./...
go test -race ./...
- name: Measure Coverage
run: go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.out