Create unit-tests workflow #5
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
--- | |
name: Tests | |
on: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
- 'release/v[0-9].[0-9]' | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
check-latest: true | |
- name: Run unit-tests | |
run: go test -covermode count --coverprofile coverage.out -coverpkg=./... ./... -v | |
- name: Check coverage | |
run: go tool cover -func coverage.out | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |