Skip to content

Commit 72a0768

Browse files
authored
travis, build: speed up CI runs (#17854)
* travis: exclude non-test jobs for PRs We don't usually look at these builders and not starting them removes ~15min of build time. * build: don't run vet before tests Recent versions of Go run vet during 'go test' and we have a dedicated lint job. * build: use -timeout 5m for tests Tests sometimes hang on Travis. CI runs are aborted after 10min with no output. Adding the timeout means we get to see the stack trace for timeouts.
1 parent 459278c commit 72a0768

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

.travis.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ matrix:
4545
- go run build/ci.go lint
4646

4747
# This builder does the Ubuntu PPA upload
48-
- os: linux
48+
- if: type = push
49+
os: linux
4950
dist: trusty
5051
go: 1.11.x
5152
env:
@@ -63,7 +64,8 @@ matrix:
6364
- go run build/ci.go debsrc -signer "Go Ethereum Linux Builder <[email protected]>" -upload ppa:ethereum/ethereum
6465

6566
# This builder does the Linux Azure uploads
66-
- os: linux
67+
- if: type = push
68+
os: linux
6769
dist: trusty
6870
sudo: required
6971
go: 1.11.x
@@ -96,7 +98,8 @@ matrix:
9698
- go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
9799

98100
# This builder does the Linux Azure MIPS xgo uploads
99-
- os: linux
101+
- if: type = push
102+
os: linux
100103
dist: trusty
101104
services:
102105
- docker
@@ -123,7 +126,8 @@ matrix:
123126
- go run build/ci.go archive -arch mips64le -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
124127

125128
# This builder does the Android Maven and Azure uploads
126-
- os: linux
129+
- if: type = push
130+
os: linux
127131
dist: trusty
128132
addons:
129133
apt:
@@ -160,7 +164,8 @@ matrix:
160164
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -deploy https://oss.sonatype.org -upload gethstore/builds
161165

162166
# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads
163-
- os: osx
167+
- if: type = push
168+
os: osx
164169
go: 1.11.x
165170
env:
166171
- azure-osx
@@ -188,7 +193,8 @@ matrix:
188193
- go run build/ci.go xcode -signer IOS_SIGNING_KEY -deploy trunk -upload gethstore/builds
189194

190195
# This builder does the Azure archive purges to avoid accumulating junk
191-
- os: linux
196+
- if: type = cron
197+
os: linux
192198
dist: trusty
193199
go: 1.11.x
194200
env:
@@ -197,10 +203,3 @@ matrix:
197203
submodules: false # avoid cloning ethereum/tests
198204
script:
199205
- go run build/ci.go purge -store gethstore/builds -days 14
200-
201-
notifications:
202-
webhooks:
203-
urls:
204-
- https://webhooks.gitter.im/e/e09ccdce1048c5e03445
205-
on_success: change
206-
on_failure: always

build/ci.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd
320320
// "tests" also includes static analysis tools such as vet.
321321

322322
func doTest(cmdline []string) {
323-
var (
324-
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
325-
)
323+
coverage := flag.Bool("coverage", false, "Whether to record code coverage")
326324
flag.CommandLine.Parse(cmdline)
327325
env := build.Env()
328326

@@ -332,14 +330,11 @@ func doTest(cmdline []string) {
332330
}
333331
packages = build.ExpandPackagesNoVendor(packages)
334332

335-
// Run analysis tools before the tests.
336-
build.MustRun(goTool("vet", packages...))
337-
338333
// Run the actual tests.
339-
gotest := goTool("test", buildFlags(env)...)
340334
// Test a single package at a time. CI builders are slow
341335
// and some tests run into timeouts under load.
342-
gotest.Args = append(gotest.Args, "-p", "1")
336+
gotest := goTool("test", buildFlags(env)...)
337+
gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m")
343338
if *coverage {
344339
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
345340
}

0 commit comments

Comments
 (0)