Create golangci-lint.yml #14
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Tests | |
on: | |
push: | |
tags: | |
branches: | |
pull_request: | |
branches: | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.21' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Display Go version | |
run: go version | |
- name: Install dependencies | |
run: | | |
go mod download | |
go get -t -u golang.org/x/tools/cmd/cover | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v -race -coverprofile=coverage.out -covermode=atomic | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |