5e6b643ad6 Fix go-systemd import with Go modules (Jeremy Rand)
468f40c70e Cirrus: Fix nctestsuite when GOPATH not set (Jeremy Rand)
bb369d083c Cirrus: Fix error when GOPATH is unset (Jeremy Rand)
3db1ee0c33 Cirrus: Add Fedora Unit Tests task (Jeremy Rand)
a0eb8a7034 Cirrus: Factor out container image for Unit Test task (Jeremy Rand)
Pull request description:
Requested by Stuart Gathman for Fedora packaging.
Top commit has no ACKs.
Tree-SHA512: c09b0d7505821abd721c768cf9a13da48566004937087e0ff0eef7ab78ecf337dbc4935b7e64f3a9783a8991e23432813ac543b3578e2b4f9c34f7b7e65991e0
- 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 edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/x509-compressed=../x509-compressed
- go mod tidy
lint_script:
- cd $(go env GOPATH)/src/github.com/$CIRRUS_REPO_FULL_NAME/
@ -75,13 +74,23 @@ task:
lint_script:bash testdata/shellcheck.bash
task:
name:"Unit Tests Go $GO_VERSION$MODULES_NAME"
name:"Unit Tests $CONTAINER_NAME$MODULES_NAME"
alias:Unit Tests
container:
image:golang:$GO_VERSION
install_script:
- apt-get update
- apt-get install -y libcap-dev
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:
@ -108,8 +117,7 @@ task:
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 edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/x509-compressed=../x509-compressed
- 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:""
GO_VERSION:latest
task:
name:"Cross-Compile Go $GO_VERSION$MODULES_NAME"
@ -165,8 +173,7 @@ task:
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 edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/x509-compressed=../x509-compressed
@ -113,8 +113,7 @@ Option B: Using Go build commands with Go modules (works on any platform with Ba
~~~
go mod init
go mod tidy
go mod edit -replace github.com/namecoin/x509-compressed=../x509-compressed
go mod edit -replace github.com/coreos/go-systemd=github.com/coreos/go-systemd/v22@latest -replace github.com/namecoin/x509-compressed=../x509-compressed