-
Notifications
You must be signed in to change notification settings - Fork 11
44 lines (36 loc) · 937 Bytes
/
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 Test
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: chmod
run: chmod +x ./setup-test.sh
- name: setup tests
run: ./setup-test.sh
- name: Run tests and generate coverage report
run: |
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
name: codecov-umbrella
file: coverage.txt
fail_ci_if_error: true
slug: knbr13/gitcs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}