-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7461 from planetscale/ci-go-mod-tidy
CI: adding 'go mod tidy' test
- Loading branch information
Showing
4 changed files
with
29 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: gomod-tidy | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: Check go mod tidy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.15 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.15 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run go mod tidy | ||
run: | | ||
set -e | ||
go mod tidy | ||
output=$(git status -s) | ||
if [ -z "${output}" ]; then | ||
exit 0 | ||
fi | ||
echo 'We wish to maintain a tidy state for go mod. Please run `go mod tidy` on your branch, commit and push again.' | ||
echo 'Running `go mod tidy` on this CI test yields with the following changes:' | ||
echo "$output" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters