mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-02 13:03:11 +00:00
42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
# File managed by web3-bot. DO NOT EDIT.
|
|
# See https://github.com/protocol/.github/ for details.
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
unit:
|
|
runs-on: ubuntu-latest
|
|
name: Go checks
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.16.x"
|
|
- name: Install staticcheck
|
|
run: go install honnef.co/go/tools/cmd/staticcheck@be534f007836a777104a15f2456cd1fffd3ddee8 # v2020.2.2
|
|
- name: Check that go.mod is tidy
|
|
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
|
|
run: go vet ./...
|
|
- name: staticcheck
|
|
if: ${{ success() || failure() }} # run this step even if the previous one failed
|
|
run: |
|
|
set -o pipefail
|
|
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
|
|
|