Skip to content

Commit 6c33ba1

Browse files
committed
build: add ci.go, use it everywhere
The new build script, ci.go, replaces some of the older shell scripts. ci.go can compile go-ethereum, run the tests, create release archives and debian source packages.
1 parent a38be3e commit 6c33ba1

19 files changed

Lines changed: 938 additions & 114 deletions

‎.gitignore‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@ Godeps/_workspace/bin
2323
.project
2424
.settings
2525

26-
deploy/osx/Mist.app
27-
deploy/osx/Mist\ Installer.dmg
28-
cmd/mist/assets/ext/ethereum.js/
29-
3026
# used by the Makefile
3127
/build/_workspace/
3228
/build/bin/
29+
/geth*.zip
3330

3431
# travis
3532
profile.tmp
3633
profile.cov
37-
38-
# vagrant
39-
.vagrant

‎.gitmodules‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎.travis.yml‎

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
11
language: go
2-
go:
3-
- 1.4.2
4-
- 1.5.4
5-
- 1.6.2
2+
go_import_path: github.com/ethereum/go-ethereum
3+
sudo: false
4+
matrix:
5+
include:
6+
- os: linux
7+
dist: trusty
8+
go: 1.4.2
9+
- os: linux
10+
dist: trusty
11+
go: 1.5.4
12+
- os: linux
13+
dist: trusty
14+
go: 1.6.2
15+
- os: osx
16+
go: 1.6.2
17+
18+
# This builder does the PPA upload (and nothing else).
19+
- os: linux
20+
dist: trusty
21+
go: 1.6.2
22+
env: PPA
23+
addons:
24+
apt:
25+
packages:
26+
- devscripts
27+
- debhelper
28+
- dput
29+
script:
30+
- go run build/ci.go travis-debsrc
31+
632
install:
7-
# - go get code.google.com/p/go.tools/cmd/goimports
8-
# - go get github.com/golang/lint/golint
9-
# - go get golang.org/x/tools/cmd/vet
1033
- go get golang.org/x/tools/cmd/cover
11-
before_script:
12-
# - gofmt -l -w .
13-
# - goimports -l -w .
14-
# - golint .
15-
# - go vet ./...
16-
# - go test -race ./...
1734
script:
18-
- make travis-test-with-coverage
35+
- go run build/ci.go install
36+
- go run build/ci.go test -coverage -vet
1937
after_success:
20-
- bash <(curl -s https://codecov.io/bash)
21-
env:
22-
global:
23-
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
24-
sudo: false
38+
# - go run build/ci.go archive -type tar
39+
2540
notifications:
2641
webhooks:
2742
urls:
2843
- https://webhooks.gitter.im/e/e09ccdce1048c5e03445
2944
on_success: change
3045
on_failure: always
31-
on_start: false

‎Makefile‎

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# with Go source code. If you know what GOPATH is then you probably
33
# don't need to bother with make.
44

5-
.PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean
5+
.PHONY: geth geth-cross evm all test xgo clean
66
.PHONY: geth-linux geth-linux-386 geth-linux-amd64
77
.PHONY: geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
88
.PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
@@ -13,10 +13,29 @@ GOBIN = build/bin
1313
GO ?= latest
1414

1515
geth:
16-
build/env.sh go build -i -v $(shell build/flags.sh) -o $(GOBIN)/geth ./cmd/geth
16+
build/env.sh go run build/ci.go install ./cmd/geth
1717
@echo "Done building."
1818
@echo "Run \"$(GOBIN)/geth\" to launch geth."
1919

20+
evm:
21+
build/env.sh go run build/ci.go install ./cmd/evm
22+
@echo "Done building."
23+
@echo "Run \"$(GOBIN)/evm to start the evm."
24+
25+
all:
26+
build/env.sh go run build/ci.go install
27+
28+
test: all
29+
build/env.sh go run build/ci.go test
30+
31+
clean:
32+
rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*
33+
34+
# Cross Compilation Targets (xgo)
35+
36+
xgo:
37+
build/env.sh go get github.com/karalabe/xgo
38+
2039
geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
2140
@echo "Full cross compilation done:"
2241
@ls -ld $(GOBIN)/geth-*
@@ -96,26 +115,3 @@ geth-ios: xgo
96115
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=ios-7.0/framework -v $(shell build/flags.sh) ./cmd/geth
97116
@echo "iOS framework cross compilation done:"
98117
@ls -ld $(GOBIN)/geth-ios-*
99-
100-
evm:
101-
build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm
102-
@echo "Done building."
103-
@echo "Run \"$(GOBIN)/evm to start the evm."
104-
105-
all:
106-
for cmd in `ls ./cmd/`; do \
107-
build/env.sh go build -i -v $(shell build/flags.sh) -o $(GOBIN)/$$cmd ./cmd/$$cmd; \
108-
done
109-
110-
test: all
111-
build/env.sh go test ./...
112-
113-
travis-test-with-coverage: all
114-
build/env.sh go vet ./...
115-
build/env.sh build/test-global-coverage.sh
116-
117-
xgo:
118-
build/env.sh go get github.com/karalabe/xgo
119-
120-
clean:
121-
rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*

‎appveyor.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
os: Visual Studio 2015
2+
3+
# Clone directly into GOPATH.
4+
clone_folder: c:\gopath\src\github.com\ethereum\go-ethereum
5+
clone_depth: 5
6+
version: "{branch}.{build}"
7+
environment:
8+
global:
9+
GOPATH: c:\gopath
10+
11+
# cache choco package files so we don't hit sourceforge all
12+
# the time.
13+
cache:
14+
- c:\cache
15+
16+
install:
17+
- cmd: choco install --cache c:\cache golang mingw | find /v "Extracting "
18+
- refreshenv
19+
- cd c:\gopath\src\github.com\ethereum\go-ethereum
20+
21+
build_script:
22+
- go run build\ci.go install
23+
24+
test_script:
25+
- go run build\ci.go test -vet -coverage
26+
27+
after_build:
28+
- go run build\ci.go archive -type zip
29+
30+
artifacts:
31+
- path: geth-*.zip

‎build/ci-notes.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Debian Packaging
2+
----------------
3+
4+
Tagged releases and develop branch commits are available as installable Debian packages
5+
for Ubuntu. Packages are built for the all Ubuntu versions which are supported by
6+
Canonical:
7+
8+
- Trusty Tahr (14.04 LTS)
9+
- Wily Werewolf (15.10)
10+
- Xenial Xerus (16.04 LTS)
11+
12+
Packages of develop branch commits have suffix -unstable and cannot be installed alongside
13+
the stable version. Switching between release streams requires user intervention.
14+
15+
The packages are built and served by launchpad.net. We generate a Debian source package
16+
for each distribution and upload it. Their builder picks up the source package, builds it
17+
and installs the new version into the PPA repository. Launchpad requires a valid signature
18+
by a team member for source package uploads. The signing key is stored in an environment
19+
variable which Travis CI makes available to certain builds.
20+
21+
We want to build go-ethereum with the most recent version of Go, irrespective of the Go
22+
version that is available in the main Ubuntu repository. In order to make this possible,
23+
our PPA depends on the ~gophers/ubuntu/archive PPA. Our source package build-depends on
24+
golang-1.6, which is co-installable alongside the regular golang package. PPA dependencies
25+
can be edited at https://launchpad.net/%7Elp-fjl/+archive/ubuntu/geth-ci-testing/+edit-dependencies
26+

0 commit comments

Comments
 (0)