Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
aa45f9d6
Commit
aa45f9d6
authored
Jun 01, 2021
by
web3-bot
Committed by
Marten Seemann
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add .github/workflows/go-check.yml
parent
c0221464
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
.github/workflows/go-check.yml
.github/workflows/go-check.yml
+50
-0
No files found.
.github/workflows/go-check.yml
0 → 100644
View file @
aa45f9d6
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.
on
:
[
push
,
pull_request
]
name
:
Go Checks
jobs
:
unit
:
runs-on
:
ubuntu-latest
name
:
All
steps
:
-
uses
:
actions/checkout@v2
with
:
submodules
:
recursive
-
uses
:
actions/setup-go@v2
with
:
go-version
:
"
1.16.x"
-
name
:
Install staticcheck
run
:
go install honnef.co/go/tools/cmd/staticcheck@434f5f3816b358fe468fa83dcba62d794e7fe04b
# 2021.1 (v0.2.0)
-
name
:
Check that go.mod is tidy
uses
:
protocol/multiple-go-modules@v1.0
with
:
run
:
|
go mod tidy
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
echo "go.sum was added by go mod tidy"
exit 1
fi
git diff --exit-code -- go.sum go.mod
-
name
:
gofmt
if
:
${{ success() || failure() }}
# run this step even if the previous one failed
run
:
|
out=$(gofmt -s -l .)
if [[ -n "$out" ]]; then
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
exit 1
fi
-
name
:
go vet
if
:
${{ success() || failure() }}
# run this step even if the previous one failed
uses
:
protocol/multiple-go-modules@v1.0
with
:
run
:
go vet ./...
-
name
:
staticcheck
if
:
${{ success() || failure() }}
# run this step even if the previous one failed
uses
:
protocol/multiple-go-modules@v1.0
with
:
run
:
|
set -o pipefail
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment