add handlers, which provide the possibility to extend functionality a… #6
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Golang-CI (lint) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 # action page: <https://github.com/actions/setup-go> | |
with: | |
go-version: stable | |
- name: Run linter | |
uses: golangci/[email protected] | |
with: | |
version: v1.53 | |
args: -v --build-tags=race --timeout=5m | |
test: | |
needs: lint | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 # action page: <https://github.com/actions/setup-go> | |
with: | |
go-version: stable | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules> | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Install Go dependencies | |
run: go mod download | |
- name: Run Unit tests | |
run: go test -race -covermode=atomic -coverprofile /tmp/coverage.txt . | |
- name: Upload Coverage report to CodeCov | |
continue-on-error: true | |
uses: codecov/[email protected] # https://github.com/codecov/codecov-action | |
with: | |
file: /tmp/coverage.txt |