Skip to content

Commit

Permalink
ci: add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdmike committed Feb 7, 2024
1 parent cf45cb0 commit b95b2f9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -42,14 +41,21 @@ jobs:
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: Run go vet
run: go vet ./...
- name: Run go lint
if: ${{ matrix.os == 'ubuntu-20.04' }}
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: latest
- name: Install Test Converter and run tests
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
export GOPATH="$HOME/go/"
export PATH=$PATH:$GOPATH/bin
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v 2>&1 ./... | go-junit-report -set-exit-code > rpc-go-unit.xml
go test -covermode=atomic -coverprofile=coverage.out -race -v ./... > test_output.txt 2>&1 || true
cat test_output.txt
cat test_output.txt | go-junit-report -set-exit-code > junit.xml
if grep -q "FAIL" test_output.txt; then exit 1; fi
- name: run the tests with coverage
run: go test ./... -coverprofile=coverage.out -covermode=atomic

Expand Down

0 comments on commit b95b2f9

Please sign in to comment.