Skip to content

Commit

Permalink
travis: test go1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi committed Feb 17, 2019
1 parent adc41ab commit 6dbd893
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 36 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:

env:
- GOVERSION=1.11
- GOVERSION=1.12

install: true

Expand Down
32 changes: 6 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,11 @@ https://decred.org/downloads

Building or updating from source requires the following build dependencies:

- **Go 1.10 or 1.11**
- **Go 1.11 or 1.12**

Installation instructions can be found here: https://golang.org/doc/install.
It is recommended to add `$GOPATH/bin` to your `PATH` at this point.

- **Vgo (Go 1.10 only)**

The `GO111MODULE` experiment is used to manage project dependencies and
provide reproducible builds. The module experiment is provided by the Go 1.11
toolchain, but the Go 1.10 toolchain does not provide any module support. To
perform module-aware builds with Go 1.10,
[vgo](https://godoc.org/golang.org/x/vgo) (a drop-in replacement for the go
command) must be used instead.

- **Git**

Installation instructions can be found at https://git-scm.com or
Expand All @@ -130,16 +121,14 @@ Building or updating from source requires the following build dependencies:
To build and install from a checked-out repo, run `go install . ./cmd/...` in
the repo's root directory. Some notes:

* Set the `GO111MODULE=on` environment variable if using Go 1.11 and building
from within `GOPATH`.

* Replace `go` with `vgo` when using Go 1.10.
* Set the `GO111MODULE=on` environment variable if building from within
`GOPATH`.

* The `dcrd` executable will be installed to `$GOPATH/bin`. `GOPATH`
defaults to `$HOME/go` (or `%USERPROFILE%\go` on Windows) if unset.


### Example of obtaining and building from source on Windows 10 with Go 1.11:
### Example of obtaining and building from source on Windows 10:

```PowerShell
PS> git clone https://github.com/decred/dcrd $env:USERPROFILE\src\dcrd
Expand All @@ -149,15 +138,6 @@ PS> & "$(go env GOPATH)\bin\dcrd" -V
```

### Example of obtaining and building from source on Linux with Go 1.10:

```bash
$ git clone https://github.com/decred/dcrd ~/src/dcrd
$ cd ~/src/dcrd
$ vgo install . ./cmd/...
$ $(vgo env GOPATH)/bin/dcrd -V
```

## Docker

### Running dcrd
Expand Down Expand Up @@ -224,10 +204,10 @@ To run the tests locally without docker on the latest supported version of Go:
./run_tests.sh
```

To run the tests locally without docker on Go 1.10:
To run the tests locally without docker on Go 1.11:

```
GOVERSION=1.10 ./run_tests.sh
GOVERSION=1.11 ./run_tests.sh
```

## Contact
Expand Down
17 changes: 7 additions & 10 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash

# usage:
# ./run_tests.sh # local, go 1.11
# GOVERSION=1.10 ./run_tests.sh # local, go 1.10 (vgo)
# ./run_tests.sh docker # docker, go 1.11
# GOVERSION=1.10 ./run_tests.sh docker # docker, go 1.10 (vgo)
# ./run_tests.sh podman # podman, go 1.11
# GOVERSION=1.10 ./run_tests.sh podman # podman, go 1.10 (vgo)
# ./run_tests.sh # local, go 1.12
# GOVERSION=1.11 ./run_tests.sh # local, go 1.11
# ./run_tests.sh docker # docker, go 1.12
# GOVERSION=1.11 ./run_tests.sh docker # docker, go 1.11
# ./run_tests.sh podman # podman, go 1.12
# GOVERSION=1.11 ./run_tests.sh podman # podman, go 1.11

set -ex

Expand All @@ -28,14 +28,11 @@ set -ex
# for more details.

# Default GOVERSION
[[ ! "$GOVERSION" ]] && GOVERSION=1.11
[[ ! "$GOVERSION" ]] && GOVERSION=1.12
REPO=dcrd

testrepo () {
GO=go
if [[ $GOVERSION == 1.10 ]]; then
GO=vgo
fi

$GO version

Expand Down

0 comments on commit 6dbd893

Please sign in to comment.