Skip to content

Commit

Permalink
Update github test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adjackura committed May 3, 2021
1 parent 9692211 commit cd35bdf
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:

linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2

Expand All @@ -20,22 +23,23 @@ jobs:
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v -race $(go list ./... | grep -v /vendor/)

- name: Format
run: |
if [ -n "$(gofmt -l $(go list -f {{.Dir}} ./...| grep -v /vendor/))" ]; then
echo "Go code is not formatted:"
gofmt -d $(go list -f {{.Dir}} ./...| grep -v /vendor/)
exit 1
fi
out=$(gofmt -d $(go list -f {{.Dir}} ./...))
if [[ -n $out ]]; then
echo "Go code is not formatted:"
gofmt -d $(go list -f {{.Dir}} ./...)
exit 1
fi

- name: Vet
run: go vet $(go list ./... | grep -v /vendor/)
run: go vet ./...

- name: Build
run: go build -v ./...

- name: Test
run: go test -v -race ./...

windows:
runs-on: windows-latest
Expand All @@ -47,11 +51,11 @@ jobs:
with:
go-version: 1.15

- name: Vet
run: go vet ./...

- name: Build
run: go build -v ./...

- name: Test
run: go test -v -race $(go list ./... | grep -v /vendor/)

- name: Vet
run: go vet $(go list ./... | grep -v /vendor/)
run: go test -v ./...

0 comments on commit cd35bdf

Please sign in to comment.