Update actions/setup-go digest to 9419772 #52
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 Go Tests' | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
GO_VERSION: 1.19.4 | |
GO_WORKING_DIRECTORY: '.' | |
TEST_FILE: mockgrafana_test.go | |
jobs: | |
go-tests: | |
runs-on: ubuntu-latest | |
permissions: # Must change the job token permissions to use JWT auth | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@941977282cd715ac8e0b3adc8555bef6dc794b7e | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Verify dependencies | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go mod verify | |
- name: Build | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go build -v ./... | |
- name: Run go vet | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go vet ./... | |
- name: Install staticcheck | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go install honnef.co/go/tools/cmd/staticcheck@latest | |
- name: Run staticcheck | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: staticcheck ./... | |
- name: Install golint | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go install golang.org/x/lint/golint@latest | |
- name: Run golint | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: golint ./... | |
- name: Run tests | |
working-directory: ${{ env.GO_WORKING_DIRECTORY }} | |
run: go test -race -vet=off -v ./... | |