Skip to content

Commit

Permalink
build: add ci.go, use it everywhere
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fjl committed Jun 22, 2016
1 parent a38be3e commit 6c33ba1
Show file tree
Hide file tree
Showing 19 changed files with 938 additions and 114 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ Godeps/_workspace/bin
.project
.settings

deploy/osx/Mist.app
deploy/osx/Mist\ Installer.dmg
cmd/mist/assets/ext/ethereum.js/

# used by the Makefile
/build/_workspace/
/build/bin/
/geth*.zip

# travis
profile.tmp
profile.cov

# vagrant
.vagrant
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

54 changes: 34 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
language: go
go:
- 1.4.2
- 1.5.4
- 1.6.2
go_import_path: github.com/ethereum/go-ethereum
sudo: false
matrix:
include:
- os: linux
dist: trusty
go: 1.4.2
- os: linux
dist: trusty
go: 1.5.4
- os: linux
dist: trusty
go: 1.6.2
- os: osx
go: 1.6.2

# This builder does the PPA upload (and nothing else).
- os: linux
dist: trusty
go: 1.6.2
env: PPA
addons:
apt:
packages:
- devscripts
- debhelper
- dput
script:
- go run build/ci.go travis-debsrc

install:
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get github.com/golang/lint/golint
# - go get golang.org/x/tools/cmd/vet
- go get golang.org/x/tools/cmd/cover
before_script:
# - gofmt -l -w .
# - goimports -l -w .
# - golint .
# - go vet ./...
# - go test -race ./...
script:
- make travis-test-with-coverage
- go run build/ci.go install
- go run build/ci.go test -coverage -vet
after_success:
- bash <(curl -s https://codecov.io/bash)
env:
global:
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
sudo: false
# - go run build/ci.go archive -type tar

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/e09ccdce1048c5e03445
on_success: change
on_failure: always
on_start: false
46 changes: 21 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

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

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

evm:
build/env.sh go run build/ci.go install ./cmd/evm
@echo "Done building."
@echo "Run \"$(GOBIN)/evm to start the evm."

all:
build/env.sh go run build/ci.go install

test: all
build/env.sh go run build/ci.go test

clean:
rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*

# Cross Compilation Targets (xgo)

xgo:
build/env.sh go get github.com/karalabe/xgo

geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
@echo "Full cross compilation done:"
@ls -ld $(GOBIN)/geth-*
Expand Down Expand Up @@ -96,26 +115,3 @@ geth-ios: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=ios-7.0/framework -v $(shell build/flags.sh) ./cmd/geth
@echo "iOS framework cross compilation done:"
@ls -ld $(GOBIN)/geth-ios-*

evm:
build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm
@echo "Done building."
@echo "Run \"$(GOBIN)/evm to start the evm."

all:
for cmd in `ls ./cmd/`; do \
build/env.sh go build -i -v $(shell build/flags.sh) -o $(GOBIN)/$$cmd ./cmd/$$cmd; \
done

test: all
build/env.sh go test ./...

travis-test-with-coverage: all
build/env.sh go vet ./...
build/env.sh build/test-global-coverage.sh

xgo:
build/env.sh go get github.com/karalabe/xgo

clean:
rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*
31 changes: 31 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
os: Visual Studio 2015

# Clone directly into GOPATH.
clone_folder: c:\gopath\src\github.com\ethereum\go-ethereum
clone_depth: 5
version: "{branch}.{build}"
environment:
global:
GOPATH: c:\gopath

# cache choco package files so we don't hit sourceforge all
# the time.
cache:
- c:\cache

install:
- cmd: choco install --cache c:\cache golang mingw | find /v "Extracting "
- refreshenv
- cd c:\gopath\src\github.com\ethereum\go-ethereum

build_script:
- go run build\ci.go install

test_script:
- go run build\ci.go test -vet -coverage

after_build:
- go run build\ci.go archive -type zip

artifacts:
- path: geth-*.zip
26 changes: 26 additions & 0 deletions build/ci-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Debian Packaging
----------------

Tagged releases and develop branch commits are available as installable Debian packages
for Ubuntu. Packages are built for the all Ubuntu versions which are supported by
Canonical:

- Trusty Tahr (14.04 LTS)
- Wily Werewolf (15.10)
- Xenial Xerus (16.04 LTS)

Packages of develop branch commits have suffix -unstable and cannot be installed alongside
the stable version. Switching between release streams requires user intervention.

The packages are built and served by launchpad.net. We generate a Debian source package
for each distribution and upload it. Their builder picks up the source package, builds it
and installs the new version into the PPA repository. Launchpad requires a valid signature
by a team member for source package uploads. The signing key is stored in an environment
variable which Travis CI makes available to certain builds.

We want to build go-ethereum with the most recent version of Go, irrespective of the Go
version that is available in the main Ubuntu repository. In order to make this possible,
our PPA depends on the ~gophers/ubuntu/archive PPA. Our source package build-depends on
golang-1.6, which is co-installable alongside the regular golang package. PPA dependencies
can be edited at https://launchpad.net/%7Elp-fjl/+archive/ubuntu/geth-ci-testing/+edit-dependencies

Loading

0 comments on commit 6c33ba1

Please sign in to comment.