-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.1 KB
/
default.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
name: Test
on:
push:
branches: [master]
pull_request:
jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
go-version: [1.22.x]
runs-on: ${{ matrix.os }}
env:
COVERPROFILE: ./cover.out
COVERDIR: ${{ github.workspace }}/.coverage
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Test and Coverage
shell: bash
id: test
run: |
make test
echo "COVERAGE_FILES=$(find ${{ env.COVERDIR }} -type f | tr '\n' ',' | sed 's/,$//')" | tee -a $GITHUB_OUTPUT
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.test.outputs.COVERAGE_FILES }}
verbose: true