-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (39 loc) · 1.18 KB
/
tests.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
42
43
44
45
46
47
48
name: tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ['stable', 'oldstable']
runs-on: ${{ matrix.os }}
steps:
- name: Enable long paths on git checkouts
run: git config --global core.longpaths true
- uses: actions/checkout@v4
with:
submodules: 'true'
lfs: 'true'
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Test with coverage
run: go test -v -coverprofile="coverage-${{ matrix.os }}-${{ matrix.go-version }}.txt" -covermode=count ./...
- name: Codegen with coverage
env:
GOCOVERDIR: "${{ github.workspace }}/coverage"
run: |
mkdir coverage
go generate ./...
go tool covdata textfmt -i=coverage -o=coverage-sszgen-${{ matrix.os }}-${{ matrix.go-version }}.txt
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}