File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,29 @@ jobs:
1818 uses : actions/checkout@v2
1919
2020 - name : Verify dependencies
21- run : go mod verify
21+ shell : bash
22+ run : |
23+ go mod verify
24+ go mod download
2225
23- - name : Build
26+ - name : Run tests
2427 shell : bash
2528 run : |
26- go test -race ./...
27- go build -v ./cmd/gh
29+ assert-nothing-changed() {
30+ local diff
31+ git checkout -- .
32+ "$@" >/dev/null || true
33+ if ! diff="$(git diff -U1 --color --exit-code)"; then
34+ printf '\n\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n' "$*" "$diff" >&2
35+ return 1
36+ fi
37+ }
38+
39+ STATUS=0
40+ go test -race ./... || STATUS=$?
41+ assert-nothing-changed go fmt ./... || STATUS=$?
42+ assert-nothing-changed go mod tidy || STATUS=$?
43+ exit $STATUS
44+
45+ - name : Build
46+ run : go build -v ./cmd/gh
You can’t perform that action at this time.
0 commit comments