Skip to content

Commit

Permalink
Merge pull request #182 from CosmosContracts/add_tidy_ci
Browse files Browse the repository at this point in the history
Spike tidy CI action
  • Loading branch information
faddat authored Apr 15, 2022
2 parents dd595e9 + 20c4f6e commit 6300700
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

test:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v2
Expand All @@ -24,3 +25,23 @@ jobs:
uses: actions/checkout@v2
- name: Test
run: go test ./...

# Use --check or --exit-code when available (Go 1.19?)
# https://github.com/golang/go/issues/27005
tidy:
runs-on: ubuntu-latest
name: tidy
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.17
- run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi

0 comments on commit 6300700

Please sign in to comment.