2018-05-30 03:38:55 +02:00
|
|
|
os: linux
|
2021-12-14 22:35:44 +01:00
|
|
|
dist: bionic
|
2018-05-30 03:38:55 +02:00
|
|
|
language: go
|
|
|
|
|
2018-12-25 21:45:11 +01:00
|
|
|
go:
|
2023-07-07 15:34:22 +02:00
|
|
|
- 1.20.x
|
2018-05-30 03:38:55 +02:00
|
|
|
|
2019-02-08 23:33:43 +01:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.cache/go-build
|
|
|
|
- $HOME/gopath/pkg/mod
|
|
|
|
|
2018-05-30 03:38:55 +02:00
|
|
|
notifications:
|
|
|
|
email: false
|
|
|
|
|
2018-12-25 21:45:11 +01:00
|
|
|
# Skip the install step. Don't `go get` dependencies. Only build with the code in vendor/
|
2021-12-14 22:35:44 +01:00
|
|
|
#install: true
|
2018-08-07 18:53:00 +02:00
|
|
|
|
2018-05-30 03:38:55 +02:00
|
|
|
# Anything in before_script that returns a nonzero exit code will
|
|
|
|
# flunk the build and immediately stop. It's sorta like having
|
|
|
|
# set -e enabled in bash.
|
|
|
|
before_script:
|
|
|
|
# All the .go files, excluding vendor/ and model (auto generated)
|
2020-07-10 15:24:48 +02:00
|
|
|
- GO_FILES=$(find . -iname '*.go' ! -iname '*_test.go' -type f | grep -v /vendor/ ) #i wish we were this crazy :p
|
2021-12-14 22:35:44 +01:00
|
|
|
- go install golang.org/x/tools/cmd/goimports # Used in build script for generated files
|
2019-03-22 04:37:01 +01:00
|
|
|
# - go get github.com/golang/lint/golint # Linter
|
2019-06-20 19:13:57 +02:00
|
|
|
# - go get honnef.co/go/tools/cmd/megacheck # Badass static analyzer/linter
|
2021-12-14 22:35:44 +01:00
|
|
|
- go install github.com/fzipp/gocyclo/cmd/gocyclo@latest # Check against high complexity
|
|
|
|
- go install github.com/mdempsky/unconvert@latest # Identifies unnecessary type conversions
|
|
|
|
- go install github.com/kisielk/errcheck@latest # Checks for unhandled errors
|
|
|
|
- go install github.com/opennota/check/cmd/varcheck@latest # Checks for unused vars
|
|
|
|
- go install github.com/opennota/check/cmd/structcheck@latest # Checks for unused fields in structs
|
2018-05-30 03:38:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# script always run to completion (set +e). All of these code checks are must haves
|
|
|
|
# in a modern Go project.
|
|
|
|
script:
|
|
|
|
# Fail if a .go file hasn't been formatted with gofmt
|
2021-12-14 22:35:44 +01:00
|
|
|
- for i in $GO_FILES; do test -z $(gofmt -s -l $i); done
|
2018-05-30 03:38:55 +02:00
|
|
|
# Run unit tests
|
2018-08-31 01:52:29 +02:00
|
|
|
- make test
|
2018-05-30 03:38:55 +02:00
|
|
|
# Checks for unused vars and fields on structs
|
|
|
|
- varcheck ./...
|
|
|
|
- structcheck ./...
|
|
|
|
# go vet is the official Go static analyzer
|
|
|
|
- go vet ./...
|
|
|
|
# forbid code with huge functions
|
2018-08-07 17:53:29 +02:00
|
|
|
#- gocyclo -ignore "_test.go" -avg -over 19 $GO_FILES
|
2018-05-30 03:38:55 +02:00
|
|
|
# checks for unhandled errors
|
2018-12-25 21:45:11 +01:00
|
|
|
# - errcheck ./... # COMMENTED OUT UNTIL https://github.com/kisielk/errcheck/issues/155 is fixed
|
2018-05-30 03:38:55 +02:00
|
|
|
# "go vet on steroids" + linter - ignore autogen code
|
2018-12-25 21:45:11 +01:00
|
|
|
# - megacheck -simple.exit-non-zero=true ./... # DISABLED UNTIL https://github.com/dominikh/go-tools/issues/328 is fixed
|
2018-05-30 03:38:55 +02:00
|
|
|
# check for unnecessary conversions - ignore autogen code
|
2018-12-25 21:45:11 +01:00
|
|
|
# - unconvert ./... # SEEMS TO BE BROKEN WITH GO MODULES
|
2018-05-30 03:38:55 +02:00
|
|
|
# one last linter - ignore autogen code
|
2018-08-07 17:53:29 +02:00
|
|
|
#- golint -set_exit_status $(go list ./... | grep -v /vendor/ )
|
2018-08-30 22:50:46 +02:00
|
|
|
# Finally, build the binary
|
2023-03-09 18:41:41 +01:00
|
|
|
- make linux
|
2018-08-07 18:25:02 +02:00
|
|
|
|
|
|
|
deploy:
|
2018-08-30 22:50:46 +02:00
|
|
|
- provider: s3
|
2023-03-09 18:41:41 +01:00
|
|
|
local_dir: ./dist/linux_amd64
|
2018-08-31 01:52:29 +02:00
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
|
|
|
repo: lbryio/reflector.go
|
2018-08-30 22:50:46 +02:00
|
|
|
access_key_id:
|
2018-08-31 00:19:42 +02:00
|
|
|
secure: "ABmoSTxTee1GubJmmi+MlyBcnqRT0ywEOtTL4hrH7T+Vj5UPcNBhjqGRiMXzO3MdrVWom19OnqMvsvAdehrB4uQJVlX/+zB26gTpEiiU5dWJgerNAYmfxDGNz/p9pyYWLvVY/cymSlJ4HkggJVg+dMTBTOP+gTNgQUhHL7pAd/Z5HMPmPW/rlNlQgDdczoY44OdiniuHny4Lr7mo8dcT4dcyJysPpHLCPGWp3kXcffIEbgO02aQZ14BbX9oU9xm1BacYnr4t8gRCU+uK0mt7TREHUzZ8bQBRXUymmpeeEQshXdifdwtk6sdRGIZiTi0NmQ7kYter6oh6623TH6rpNy/lkxKi823FbSPC1XZGH7CwcbnSIEwY++7e9PT0EA14VuDUF7+iXC/gpRkVQwUoMcoC9rHBjkXW+SiwHWoUeDKXrfVO9QGEJTi5bDRNwklwu2zkYWeRIPzfDaVayUBYwjunjT1eST997ygmJwJTJ6DeOWLx+WFlmwBJfQpBwbrlMrceiNjreMwGB6ffXEBzuM6S5inXGIChllGDpNyJeFVcH9zPpU0JsIpWoRjwLNFOiEhFsnzK5rvA2SKmlOOnSlgOCBQnFi2SmLDM790KoY8qjan2s984chQz2qsKnhYuVpJhG6LKgrI1QwE0KHr80spVFfewq11AU4Q+lfA9aAQ="
|
2018-08-30 22:50:46 +02:00
|
|
|
secret_access_key:
|
2018-08-31 00:19:42 +02:00
|
|
|
secure: "AxYRTy/GnjeTJKQdeJ/AEeAd+yXs783bFDKdyKNswtsHlU8sWPQgNcvTLpVqnSQMpiwkGDGi/70rvR5C+AT3SIWNw13RYrgBRpduQU0J+B2JS+3dN2DIePu25uvs++Wo22OfS8I+UjZ1mWY1SSHI2spPXvDCq5tb+Ih8nlYflEyAtxU9Oq2R3Kus2tkIlRnL25sP/2fY7RvuJFYIV63z8ZIJRzB5WzOeERqnXq2zfwos+hycAqyo/VevJnWAYTEDsvBuSODOpZF+QfKtIQ2rYSoqy8Lq1M6UOZimnC3Ulea4euBVf2ssBCnI7csGNG5UzkTiwrPDi2xIP8nM01rHW1yHJ7tQsJaghnUsfw2t6ui4ZofvbbOFTN/YCloHITifEi8Tc1/17isi3y+kX5yQ/Nk5UNry0Wbt91CP+nkL/ZmA5grkBXDL7VJMmB60TnO3ap24CtwBQartN3LoWs7h+4ov+LqbCt6IqpJVWQWlwJeb2MFPFByALtBpsqAyL1SxXlGNpPa94CuXxfQ6Bv436PtefA5FlTzR8uMmqsjWciv06bVnSvVlFEVovN2Fkplrjt7AASJ/8KJs4THDg4k61nfd8roAHx6ewQzl4wCWKCikQ0MuFd2mVHwdrbnCH1mIHuPRyvWMMIAK0ooc1/rmKiJlpgumjxoFYNE10MXtt+I="
|
2018-08-30 22:50:46 +02:00
|
|
|
bucket: "lbry-reflector-binary"
|
2019-03-22 14:12:10 +01:00
|
|
|
|
2019-10-03 20:02:00 +02:00
|
|
|
# - provider: releases
|
|
|
|
# file: ./bin/prism-bin
|
|
|
|
# skip_cleanup: true
|
|
|
|
# on:
|
|
|
|
# repo: lbryio/reflector.go
|
|
|
|
# tags: true
|
|
|
|
# api_key:
|
|
|
|
# secure: epAlhp3SUr8hhISarJ22n6tRw2TEa4s4oNFIvJUb5HGECVp1SYN7ao0ln5NoNLmfJS60pi911i/kMhhi21/uhZ0kCYlEhhIE2pc1zsiAxK9L9ENCssJ205HfVbe5grhwskLGzgjhU9OznO8WtmyOPWXr0it8M8RCTjx6rEC0A33Id3WMYyhP938Sj9CxEYeH4KS8wFvBXkgBVtrgaYwRTCIROFddHFXOb9jyNhqQ1RbfKtllsVtQhVk5WMlomheBNSS4vr6WMS4X4+2okFqnLtiSn1wrn5I/94UQbnrI1juVnQj0K+j32EyQbAOt4T2cLW3GtG0jhaYKyNMT9ycDCdVACPSDELlHWjeyoes9bnhUFftm6kDbQxwA1UsTF1yG8tMKXxBSmYyoT7qDloi6pBifZMrFXL61uTs6yhVB9LS/2oqg4sc0Ne87bRcn4OxsBeVCe3kbBHDTR/NTyF2gNPtRvgMAWULxTVcUm9VYdO0IWvAig5g4Row0DnFzEquD6CzezbRWD9WyZyV/AFyYHeeQ2PO7jTw0/3M7aDX33Fuhh34lehzmrC03cfgD/wZW+spxozIcQCYdiJqVw+u+/NvbNr0kkFzE9zW26JEmUFTyDvKxvnza1Kwtww3EgH6zaOL8r4yVbb54rePRvLw7pl93zlfJnEB2MCPqJOY5ZpU=
|