-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 886 Bytes
/
go-test.yaml
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
name: Go Tests
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: go mod download
run: go mod download
- name: Test
run: |
go test -cover ./... -coverprofile="cover.out"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cover.out
fail_ci_if_error: false
verbose: true
status-check:
runs-on: ubuntu-latest
needs: [test]
if: failure()
steps:
- run: exit 1