File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Go format
2+
3+ on :
4+ pull_request :
5+ branches : [ '**' ]
6+
7+ jobs :
8+ goimports_diff :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - uses : actions/setup-go@v2
13+ with :
14+ go-version : ' 1.16'
15+
16+ - name : Install goimports
17+ run : go install golang.org/x/tools/cmd/goimports@latest
18+
19+ - name : checkout
20+ uses : actions/checkout@v2
21+
22+ - name : Format all .go files
23+ run :
24+ echo "Checking files:"
25+ find . -name '*.go'
26+ goimports -w $(find . -name '*.go')
27+
28+ - name : Git diff
29+ run : git diff --exit-code
Original file line number Diff line number Diff line change 1+ name : Go test
2+
3+ on :
4+ pull_request :
5+ branches : [ '**' ]
6+
7+ jobs :
8+ run_tests :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Setup Go
13+ uses : actions/setup-go@v2
14+ with :
15+ go-version : ' 1.16'
16+
17+ - name : Set up gotestfmt
18+ uses : haveyoudebuggedit/gotestfmt-action@v1
19+ with :
20+ token : ${{ secrets.GITHUB_TOKEN }}
21+ version : v1.0.0
22+
23+ - name : checkout
24+ uses : actions/checkout@v2
25+
26+ - name : Run tests
27+ run : |
28+ # One for GitHub Action logging purposes
29+ go test -v ./... 2>&1 | gotestfmt
30+ # One for golang-test-annotations
31+ go test -json ./... > test-results.json
32+
33+ - name : Annotate tests
34+ if : always()
35+ uses : guyarb/golang-test-annotations@v0.5.0
36+ with :
37+ test-results : test-results.json
You can’t perform that action at this time.
0 commit comments