-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 875 Bytes
/
ci.yml
File metadata and controls
30 lines (30 loc) · 875 Bytes
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
name: CI
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- name: Run tests with race detection
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
# Do not run coverage if it's a fork since it won't get access to secrets
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true