Skip to content

Commit da65297

Browse files
authored
Fix Travis script to be hermetic (#68)
Fix the Travis script to be hermetic such that the test result is agnostic to when in time it is run. That is, all of the dependencies are explicitly versioned.
1 parent 0cce0f3 commit da65297

File tree

5 files changed

+50
-10
lines changed

5 files changed

+50
-10
lines changed

.travis.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,29 @@ before_install:
88
- (cd zstd-1.3.2 && sudo make install)
99
- rm -rf zstd-1.3.2
1010
- sudo ldconfig
11-
before_script:
12-
- go get github.com/golang/lint/golint
13-
- go get honnef.co/go/tools/cmd/staticcheck
11+
- mkdir /tmp/go1.12
12+
- curl -L -s https://dl.google.com/go/go1.12.linux-amd64.tar.gz | tar -zxf - -C /tmp/go1.12 --strip-components 1
13+
- unset GOROOT
14+
- (GO111MODULE=on /tmp/go1.12/bin/go mod vendor)
15+
- (cd /tmp && GO111MODULE=on /tmp/go1.12/bin/go get golang.org/x/lint/golint@8f45f776aaf18cebc8d65861cc70c33c60471952)
16+
- (cd /tmp && GO111MODULE=on /tmp/go1.12/bin/go get honnef.co/go/tools/cmd/[email protected])
1417
matrix:
1518
include:
16-
- go: 1.7.x
17-
script: go test -v -race ./...
18-
- go: 1.x
19-
script: ./ztest.sh
19+
- go: 1.9.x
20+
script:
21+
- go test -v -race ./...
22+
- go: 1.10.x
23+
script:
24+
- go test -v -race ./...
25+
- go: 1.11.x
26+
script:
27+
- go test -v -race ./...
28+
- go: 1.12.x
29+
script:
30+
- ./ztest.sh
2031
- go: master
21-
script: go test -v -race ./...
32+
script:
33+
- go test -v -race ./...
2234
allow_failures:
2335
- go: master
2436
fast_finish: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Run the command:
6262

6363
```go get -u github.com/dsnet/compress```
6464

65-
This library requires `Go1.7` or higher in order to build.
65+
This library requires `Go1.9` or higher in order to build.
6666

6767

6868
## Packages ##

go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module github.com/dsnet/compress
2+
3+
go 1.9
4+
5+
require (
6+
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780
7+
github.com/klauspost/compress v1.4.1
8+
github.com/klauspost/cpuid v1.2.0 // indirect
9+
github.com/ulikunitz/xz v0.5.6
10+
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780 h1:tFh1tRc4CA31yP6qDcu+Trax5wW5GuMxvkIba07qVLY=
2+
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
3+
github.com/klauspost/compress v1.4.1 h1:8VMb5+0wMgdBykOV96DwNwKFQ+WTI4pzYURP99CcB9E=
4+
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
5+
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
6+
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
7+
github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8=
8+
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=

ztest.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ if [[ ! -z "$RET_TEST" ]]; then echo "$RET_TEST"; echo; fi
2222
echo -e "${BOLD}staticcheck${RESET}"
2323
RET_SCHK=$(staticcheck \
2424
-ignore "
25-
github.com/dsnet/compress/internal/prefix/*.go:SA4016
2625
github.com/dsnet/compress/brotli/*.go:SA4016
26+
github.com/dsnet/compress/brotli/*.go:S1023
27+
github.com/dsnet/compress/brotli/*.go:U1000
28+
github.com/dsnet/compress/bzip2/*.go:S1023
29+
github.com/dsnet/compress/flate/*.go:U1000
30+
github.com/dsnet/compress/internal/cgo/lzma/*.go:SA4000
31+
github.com/dsnet/compress/internal/prefix/*.go:S1004
32+
github.com/dsnet/compress/internal/prefix/*.go:S1023
33+
github.com/dsnet/compress/internal/prefix/*.go:SA4016
34+
github.com/dsnet/compress/internal/tool/bench/*.go:S1007
35+
github.com/dsnet/compress/xflate/internal/meta/*.go:S1023
2736
" ./... 2>&1)
2837
if [[ ! -z "$RET_SCHK" ]]; then echo "$RET_SCHK"; echo; fi
2938

3039
echo -e "${BOLD}lint${RESET}"
3140
RET_LINT=$(golint ./... 2>&1 |
41+
egrep -v "^vendor/" |
3242
egrep -v "should have comment(.*)or be unexported" |
3343
egrep -v "^(.*)type name will be used as(.*)by other packages" |
3444
egrep -v "^brotli/transform.go:(.*)replace i [+]= 1 with i[+]{2}" |

0 commit comments

Comments
 (0)