fixed issue #51 #124
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go: | |
- '^1.18' | |
- '^1.19' | |
- '^1.20' | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
cache: true | |
- name: Declare some variables | |
id: vars | |
run: | | |
echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt" | |
- name: Test Coverage (pkg) | |
run: go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }} | |
- name: Upload coverage | |
if: ${{ matrix.go == '^1.20' }} | |
uses: codecov/codecov-action@v2 | |
with: | |
files: ${{ steps.vars.outputs.coverage_txt }} | |