pin golangci-lint version to latest available, fix reported errors #17
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: run | |
on: | |
push: | |
branches: | |
tags: | |
pull_request: | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up go 1.20 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.20" | |
- name: build and test | |
run: go test -race -timeout=60s -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov ./... | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.58 | |
- name: install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: submit coverage | |
run: | | |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" | |
export GIT_TAG="${GITHUB_REF/refs\/tags\//}" | |
if [[ "$GIT_TAG" != "$GITHUB_REF" ]]; then | |
export GIT_BRANCH=$GIT_TAG | |
fi | |
echo "coverage for branch $GIT_BRANCH" | |
goveralls -service="GitHub Action" -coverprofile=$GITHUB_WORKSPACE/profile.cov | |
env: | |
COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}} |