mirror of https://github.com/namecoin/ncdns
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
331 lines
12 KiB
YAML
331 lines
12 KiB
YAML
# Attention: if you submit an improvement for a Namecoin Cirrus config, please
|
|
# file a GitHub issue about it at the namecoin/meta repo, so that we can make
|
|
# sure it propagates to all the other Namecoin repos. Thanks!
|
|
|
|
task:
|
|
alias: Go Lint
|
|
container:
|
|
image: golangci/golangci-lint:latest
|
|
install_script:
|
|
- apt-get update
|
|
- apt-get install -y libcap-dev
|
|
path_script:
|
|
- source testdata/move_to_gopath.bash
|
|
matrix:
|
|
- env:
|
|
GO111MODULE: "off"
|
|
GOLANGCI_MODULES_ARGS: "--disable=gomoddirectives,gomodguard"
|
|
MODULES_NAME: " Modules Off"
|
|
fetch_script:
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- GOOS=windows go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- go generate github.com/namecoin/certinject/...
|
|
- go generate github.com/namecoin/x509-compressed/...
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- env:
|
|
GOLANGCI_MODULES_ARGS: ""
|
|
MODULES_NAME: ""
|
|
certinject_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/certinject.git
|
|
- cd certinject
|
|
#- go mod init github.com/namecoin/certinject
|
|
#- go mod tidy
|
|
- go generate ./...
|
|
#- go mod tidy
|
|
#- go install -v ./...
|
|
x509_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/x509-compressed.git
|
|
- cd x509-compressed
|
|
- go mod init github.com/namecoin/x509-compressed
|
|
- go mod tidy
|
|
- go generate ./...
|
|
- go mod tidy
|
|
- go install -v ./...
|
|
fetch_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod init github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/certinject=../certinject -replace github.com/namecoin/x509-compressed=../x509-compressed
|
|
- go mod tidy
|
|
lint_script:
|
|
- cd $(go env GOPATH)/src/github.com/$CIRRUS_REPO_FULL_NAME/
|
|
- golangci-lint run --enable-all --disable gochecknoglobals,gomnd,interfacer $GOLANGCI_ARGS $GOLANGCI_MODULES_ARGS -v --timeout 5m --out-format json > $CIRRUS_WORKING_DIR/lint-report.json
|
|
matrix:
|
|
- name: "Go Lint $GOOS New$MODULES_NAME"
|
|
env:
|
|
GOLANGCI_ARGS: "--new-from-rev=HEAD~"
|
|
- name: "Go Lint $GOOS Mandatory$MODULES_NAME"
|
|
env:
|
|
# TODO: Re-enable varnamelen after golangci-lint v1.44 is released.
|
|
GOLANGCI_ARGS: "--disable=cyclop,deadcode,errorlint,exhaustivestruct,forbidigo,forcetypeassert,funlen,gci,gocognit,gocritic,godot,godox,goerr113,gofumpt,goimports,golint,gosec,gosimple,govet,ineffassign,lll,maligned,nakedret,nestif,nilerr,nlreturn,paralleltest,revive,scopelint,staticcheck,stylecheck,thelper,unconvert,unparam,unused,varnamelen,wastedassign,whitespace,wrapcheck,wsl"
|
|
- name: "Go Lint $GOOS$MODULES_NAME"
|
|
env:
|
|
GOLANGCI_ARGS: ""
|
|
allow_failures: true
|
|
matrix:
|
|
- env:
|
|
GOOS: linux
|
|
- env:
|
|
GOOS: windows
|
|
always:
|
|
golangci_artifacts:
|
|
path: lint-report.json
|
|
type: text/json
|
|
format: golangci
|
|
|
|
task:
|
|
name: ShellCheck
|
|
container:
|
|
image: fedora:latest
|
|
cpu: 1
|
|
memory: 1G
|
|
install_script: dnf install -y ShellCheck
|
|
lint_script: bash testdata/shellcheck.bash
|
|
|
|
task:
|
|
name: "Unit Tests $CONTAINER_NAME$MODULES_NAME"
|
|
alias: Unit Tests
|
|
matrix:
|
|
- env:
|
|
GO_VERSION: latest
|
|
CONTAINER_NAME: "Go $GO_VERSION"
|
|
container:
|
|
image: golang:$GO_VERSION
|
|
install_script:
|
|
- apt-get update
|
|
- apt-get install -y libcap-dev
|
|
- env:
|
|
CONTAINER_NAME: "Fedora latest"
|
|
container:
|
|
image: fedora:latest
|
|
install_script:
|
|
- dnf install -y golang libcap-devel
|
|
path_script:
|
|
- source testdata/move_to_gopath.bash
|
|
matrix:
|
|
- env:
|
|
GO111MODULE: "off"
|
|
MODULES_NAME: " Modules Off"
|
|
fetch_script:
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- GOOS=windows go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- go generate github.com/namecoin/certinject/...
|
|
- go generate github.com/namecoin/x509-compressed/...
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- env:
|
|
MODULES_NAME: ""
|
|
certinject_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/certinject.git
|
|
- cd certinject
|
|
#- go mod init github.com/namecoin/certinject
|
|
#- go mod tidy
|
|
- go generate ./...
|
|
#- go mod tidy
|
|
#- go install -v ./...
|
|
x509_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/x509-compressed.git
|
|
- cd x509-compressed
|
|
- go mod init github.com/namecoin/x509-compressed
|
|
- go mod tidy
|
|
- go generate ./...
|
|
- go mod tidy
|
|
- go install -v ./...
|
|
fetch_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod init github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/certinject=../certinject -replace github.com/namecoin/x509-compressed=../x509-compressed
|
|
- go mod tidy
|
|
# Get the test suite
|
|
- mkdir -p $(go env GOPATH)/src/github.com/hlandau
|
|
- cd $(go env GOPATH)/src/github.com/hlandau
|
|
- git clone https://github.com/hlandau/nctestsuite.git
|
|
test_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go install -tags "$GOX_TAGS" -v ./...
|
|
- export GOPATH=$(go env GOPATH)
|
|
- go test -tags "$GOX_TAGS" -v github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
env:
|
|
GOX_TAGS: ""
|
|
|
|
task:
|
|
name: "Cross-Compile Go $GO_VERSION$MODULES_NAME"
|
|
alias: Cross-Compile
|
|
container:
|
|
image: golang:$GO_VERSION
|
|
cpu: 8
|
|
memory: 8G
|
|
install_script:
|
|
- dpkg --add-architecture i386
|
|
- dpkg --add-architecture armhf
|
|
- dpkg --add-architecture arm64
|
|
# TODO: Support cgo for ppc64.
|
|
- dpkg --add-architecture ppc64el
|
|
- apt-get update
|
|
- apt-get install -y gcc-multilib libcap-dev libc6-dev:i386 libcap-dev:i386 libc6-dev:armhf libcap-dev:armhf libc6-dev:arm64 libcap-dev:arm64 libc6-dev:ppc64el libcap-dev:ppc64el
|
|
- go get github.com/mitchellh/gox
|
|
path_script:
|
|
- source testdata/move_to_gopath.bash
|
|
matrix:
|
|
- env:
|
|
GO111MODULE: "off"
|
|
MODULES_NAME: " Modules Off"
|
|
fetch_script:
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- GOOS=windows go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- go generate github.com/namecoin/certinject/...
|
|
- go generate github.com/namecoin/x509-compressed/...
|
|
- go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/...
|
|
- env:
|
|
MODULES_NAME: ""
|
|
certinject_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/certinject.git
|
|
- cd certinject
|
|
#- go mod init github.com/namecoin/certinject
|
|
#- go mod tidy
|
|
- go generate ./...
|
|
#- go mod tidy
|
|
#- go install -v ./...
|
|
x509_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- cd ../
|
|
- git clone https://github.com/namecoin/x509-compressed.git
|
|
- cd x509-compressed
|
|
- go mod init github.com/namecoin/x509-compressed
|
|
- go mod tidy
|
|
- go generate ./...
|
|
- go mod tidy
|
|
- go install -v ./...
|
|
fetch_script:
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod init github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- go mod edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/certinject=../certinject -replace github.com/namecoin/x509-compressed=../x509-compressed
|
|
- go mod tidy
|
|
build_script:
|
|
- rm -rf idist
|
|
- cd $(go env GOPATH)/src/github.com/"$CIRRUS_REPO_FULL_NAME"
|
|
- CGO_ENABLED=1 gox -tags="$GOX_TAGS" -parallel=8 -osarch 'linux/386 linux/amd64 linux/arm linux/arm64 linux/ppc64le' -output "$GOPATH/releasing/idist/$CIRRUS_REPO_NAME-$CIRRUS_TAG-{{.OS}}_{{.Arch}}/bin/{{.Dir}}" ./...
|
|
- CGO_ENABLED=0 gox -tags="$GOX_TAGS" -parallel=8 -osarch 'darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/ppc64 openbsd/386 openbsd/amd64 netbsd/386 netbsd/amd64 netbsd/arm dragonfly/amd64 solaris/amd64 windows/386 windows/amd64' -output "$GOPATH/releasing/idist/$CIRRUS_REPO_NAME-$CIRRUS_TAG-{{.OS}}_{{.Arch}}/bin/{{.Dir}}" ./...
|
|
dist_script:
|
|
- mv $GOPATH/releasing/idist ./idist
|
|
- bash "testdata/dist.bash"
|
|
binaries_artifacts:
|
|
path: "dist/*"
|
|
env:
|
|
GOX_TAGS: ""
|
|
GO_VERSION: latest
|
|
|
|
task:
|
|
name: Resolve Tests Electrum Unbound
|
|
container:
|
|
image: fedora:latest
|
|
cpu: 1
|
|
memory: 1G
|
|
install_script:
|
|
- curl -o /usr/bin/electrum-nmc https://www.namecoin.org/files/electrum-nmc/electrum-nmc-4.0.0b0/electrum-nmc-nc4.0.0b0-x86_64.AppImage
|
|
- chmod +x /usr/bin/electrum-nmc
|
|
# Extract Electrum-NMC AppImage
|
|
- electrum-nmc --offline version
|
|
- curl -o ncdns.tar.gz https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Cross-Compile%20Go%20latest/binaries/dist/ncdns--linux_amd64.tar.gz
|
|
- tar -xaf ./ncdns.tar.gz
|
|
- mv ./ncdns-*/bin/* /usr/bin/
|
|
- dnf install -y bind-dnssec-utils # For dnssec-keygen
|
|
- dnf install -y bind-utils # For dig
|
|
- dnf install -y unbound
|
|
# Set up DNSSEC
|
|
- mkdir KSK
|
|
- dnssec-keygen -a RSASHA256 -3 -b 2048 -f KSK -K KSK bit
|
|
- mkdir ZSK
|
|
- dnssec-keygen -a RSASHA256 -3 -b 2048 -K ZSK bit
|
|
- mkdir -p /etc/unbound/keys/ /etc/unbound/conf.d/
|
|
- cp KSK/*.key /etc/unbound/keys/bit.key
|
|
- cp _doc/unbound/conf.d/ncdns.conf /etc/unbound/conf.d/
|
|
- cp _doc/unbound/conf.d/ncdns-dnssec-on.conf /etc/unbound/conf.d/
|
|
electrum_background_script:
|
|
- electrum-nmc $ELECTRUM_ARGS -v
|
|
ncdns_background_script:
|
|
- ncdns -ncdns.namecoinrpcusername user -ncdns.namecoinrpcpassword pass -ncdns.bind :5391 -ncdns.privatekey ./KSK/*.private -ncdns.publickey ./KSK/*.key -ncdns.zoneprivatekey ./ZSK/*.private -ncdns.zonepublickey ./ZSK/*.key -xlog.severity DEBUG
|
|
unbound_background_script:
|
|
- unbound
|
|
resolve_electrum_script:
|
|
- while ! electrum-nmc $ELECTRUM_ARGS name_show d/namecoin
|
|
- do
|
|
- echo Waiting for Electrum-NMC to sync...
|
|
- sleep 1s
|
|
- done
|
|
- electrum-nmc $ELECTRUM_ARGS name_show d/namecoin | grep $NAMECOIN_IP
|
|
resolve_ncdns_script:
|
|
- dig -p 5391 @127.0.0.1 namecoin.bit
|
|
- dig -p 5391 @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
|
|
- dig -p 5391 +tcp @127.0.0.1 namecoin.bit
|
|
- dig -p 5391 +tcp @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
|
|
resolve_unbound_script:
|
|
- dig -p 53 @127.0.0.1 namecoin.bit
|
|
- dig -p 53 @127.0.0.1 namecoin.bit | grep $NAMECOIN_IP
|
|
depends_on:
|
|
- "Cross-Compile Go latest"
|
|
env:
|
|
# Workaround FUSE/Docker incompatibility.
|
|
# See https://github.com/AppImage/AppImageKit/issues/828#issuecomment-730002566
|
|
APPIMAGE_EXTRACT_AND_RUN: 1
|
|
NO_CLEANUP: 1
|
|
NAMECOIN_IP: "91.219.237.223"
|
|
ELECTRUM_ARGS: "--rpcport 8336 --rpcuser user --rpcpassword pass"
|
|
|
|
task:
|
|
# GitHub Release Upload
|
|
# TODO: implement this.
|
|
name: GitHub Release
|
|
container:
|
|
image: golang:latest
|
|
cpu: 1
|
|
memory: 1G
|
|
depends_on:
|
|
- Go Lint
|
|
- ShellCheck
|
|
- Unit Tests
|
|
- Cross-Compile
|
|
bin_cache:
|
|
folder: "idist"
|
|
fingerprint_script:
|
|
- "echo cross_compile_bin_go_%GO_VERSION%"
|
|
reupload_on_changes: false
|
|
populate_script:
|
|
- "mkdir idist"
|
|
install_script:
|
|
- go get github.com/tcnksm/ghr
|
|
release_script:
|
|
- bash "testdata/release.bash"
|
|
allow_failures: true
|
|
env:
|
|
GOX_TAGS: ""
|
|
GO_VERSION: latest
|
|
|
|
# TODO: Add Windows unit tests
|
|
|
|
# TODO: "Testing config parsing" from travis.bash
|
|
|
|
# TODO: Add multiple Go versions to Gox builds and unit tests
|
|
|
|
# TODO: Add debug stripping and path stripping to Gox for repro builds
|
|
|
|
# TODO: Re-add darwin/386 for old Go versions where it was supported
|
|
|
|
# TODO: Fix upload repo for tagged commits (don't use Nightly repo for this)
|
|
|
|
# TODO: Skip Signify and Release if it's not applicable
|
|
|
|
# TODO: Signify Nightlies
|
|
|
|
# TODO: IRC notifications on failure
|
|
|
|
# TODO: Cron
|