diff --git a/.cirrus.yml b/.cirrus.yml index 8bd0eb2..38f7f2f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,10 +11,30 @@ task: - apt-get install -y libcap-dev path_script: - source testdata/move_to_gopath.bash - fetch_script: - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... - - go generate github.com/namecoin/x509-compressed/... - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... + matrix: + - env: + GO111MODULE: "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/x509-compressed/... + - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... + - 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 + - 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 + - go mod tidy + - go mod edit -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 --no-config --enable-all --disable gochecknoglobals,gomnd $GOLANGCI_ARGS -v --timeout 5m --out-format json > $CIRRUS_WORKING_DIR/lint-report.json @@ -59,11 +79,38 @@ task: - apt-get install -y libcap-dev path_script: - source testdata/move_to_gopath.bash - fetch_script: - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... - - go generate github.com/namecoin/x509-compressed/... - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... - test_script: go test -tags "$GOX_TAGS" -v github.com/$CIRRUS_REPO_FULL_NAME/... + matrix: + - env: + GO111MODULE: "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/x509-compressed/... + - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... + - 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 + - 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 + - go mod tidy + - go mod edit -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 ./... + - go test -tags "$GOX_TAGS" -v github.com/$CIRRUS_REPO_FULL_NAME/... env: GOX_TAGS: "" GO_VERSION: latest @@ -86,17 +133,37 @@ task: - go get github.com/mitchellh/gox path_script: - source testdata/move_to_gopath.bash - fetch_script: - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... - - GOOS=windows GOARCH=amd64 go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... - - go generate github.com/namecoin/x509-compressed/... - - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... + matrix: + - env: + GO111MODULE: "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/x509-compressed/... + - go get -tags "$GOX_TAGS" -d -v -t github.com/$CIRRUS_REPO_FULL_NAME/... + - 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 + - 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 + - go mod tidy + - go mod edit -replace github.com/namecoin/x509-compressed=../x509-compressed + - go mod tidy build_script: - rm -rf idist - - 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}}" github.com/$CIRRUS_REPO_FULL_NAME/... - - 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}}" github.com/$CIRRUS_REPO_FULL_NAME/... - - mv $GOPATH/releasing/idist ./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/*"