-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (37 loc) · 923 Bytes
/
test.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
name: test
on:
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- '^1.20'
- '^1.21'
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: vet
run: go vet ./...
- name: Declare some variables
id: vars
run: |
echo "coverage_txt=${RUNNER_TEMP}/coverage.txt" >> "$GITHUB_OUTPUT"
- name: Test Coverage (pkg)
run: go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}
- name: Upload coverage
if: ${{ matrix.go == '^1.21' }}
uses: codecov/codecov-action@v3
with:
files: ${{ steps.vars.outputs.coverage_txt }}