From 25ae3744e39fd0e82664d0e3b3f55a4879be2063 Mon Sep 17 00:00:00 2001 From: William Tam Date: Fri, 24 Jul 2020 13:39:43 -0400 Subject: [PATCH 1/3] debug go fmt action --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fde5ab4..5621f7f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -39,6 +39,7 @@ jobs: - name: Check format run: | go fmt -x ./... + git status -s if [[ ! -z $(git status -s) ]] then echo "not well formatted sources are found" From 40f86c10bb8e06c50022a057f6159369edd39196 Mon Sep 17 00:00:00 2001 From: William Tam Date: Fri, 24 Jul 2020 13:47:28 -0400 Subject: [PATCH 2/3] switch the order to run "go mod tidy" first --- .github/workflows/go.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5621f7f..377b3bd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,14 +22,15 @@ 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 @@ -45,12 +46,5 @@ jobs: 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 + From b641e8ecec68afe1b68e898ecc292c56610aa922 Mon Sep 17 00:00:00 2001 From: William Tam Date: Fri, 24 Jul 2020 13:54:58 -0400 Subject: [PATCH 3/3] more debugging ... --- .github/workflows/go.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 377b3bd..d3baa15 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -30,13 +30,17 @@ jobs: 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 ./...