diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fde5ab4..d3baa15 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,34 +22,33 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Get dependencies + - name: Check go mod status run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure + go mod tidy + if [[ ! -z $(git status -s) ]] + then + echo "Go mod state is not clean" + exit 1 fi - name: Build main - run: go build main.go + run: | + go build main.go + go status -s - name: Run Go Tests - run: go test ./... - + run: | + go test ./... + go status -s + - name: Check format run: | go fmt -x ./... + git status -s if [[ ! -z $(git status -s) ]] then echo "not well formatted sources are found" exit 1 fi - - name: Check go mod status - run: | - go mod tidy - if [[ ! -z $(git status -s) ]] - then - echo "Go mod state is not clean" - exit 1 - fi +