-
Notifications
You must be signed in to change notification settings - Fork 16
41 lines (30 loc) · 1.18 KB
/
coverage.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
# coverage.yml Generate and upload Go code coverage report to Codecov.
# https://github.com/onflow/atree/blob/main/.github/workflows/coverage.yml
name: coverage
# Remove permissions from top level and grant in jobs.
permissions: {}
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 2
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
check-latest: true
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build project
run: go build ./...
- name: Generate coverage report
run: go test -timeout 60m -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.txt
fail_ci_if_error: false # we can set this to true after "Could not find a repository" upload error is fixed
verbose: true # optional (default = false)