Skip to content

Commit

Permalink
CI for building on Ubuntu #716 (#756)
Browse files Browse the repository at this point in the history
* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* use xcode: "10.1.0"

* add run  dep ensure

* restore config.yml   add test macos build

*  xcode 10.2

* test macos 10.14

* Update config.yml

* Update config.yml

* Update config.yml

* test macos  sync s3

* change sync to put

* Update config.yml

* test docker and macos  use S3 var

* Update config.yml

* Update config.yml

* test install s3

* Update install-cli.sh

* Update config.yml

* add ioctl deploy to S3

* add  --unstable  specified download S3 ioctl

Not  Working :  curl https://raw.githubusercontent.com/iotexproject/iotex-core/master/install-cli.sh --unstable | sh
Be Working:  curl https://raw.githubusercontent.com/iotexproject/iotex-core/master/install-cli.sh | sh -s "unstable"

* change docker install awscli

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* update golang 1.11

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* macos change golang to 1.11.6

* macos use curl

* Update config.yml

* Update config.yml

* Update config.yml

* ok

* nightly_ioctl_build_darwin install golang 1.11.6

* Update config.yml

* Update config.yml

* Update config.yml

* use golang 1.11.5

* debug env

* return env

* return golang 1.11.6

* enable build 3 test

* test buildcli

* install libc6-dev-i386

* sudo apt-get install libc6-dev-i386

* test release

* use pip install awscli

* aws sync

* test ioctl darwin

* test maocs ioctl

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* use requires ubuntu

* fix syntax

* disable  go build 386

* debug build ioctl

* debug ubuntu build

* debug 3  build_test_*

* skip ubuntu

* skil ubuntu

Get http://localhost:7788/liveness: dial tcp 127.0.0.1:7788: connect: connection refused

*   delete job  build_test_ubuntu
  • Loading branch information
feiren.kuang authored and zjshen14 committed Mar 19, 2019
1 parent 071e5c9 commit b1b2ffc
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 75 deletions.
156 changes: 82 additions & 74 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,115 +3,122 @@
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
build:
build_test_docker:
docker:
# specify the version
- image: iotex/iotex-core-ci:latest

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /go/src/github.com/iotexproject/iotex-core
steps:
- checkout

# specify any bash command here prefixed with `run: `
- run: golint -set_exit_status $(go list ./... | grep -v /vendor/ | grep -v /explorer/idl/ | grep -v /api/idl/)
- run: ./go.test.sh
- run: bash <(curl -s https://codecov.io/bash)
- run: go test -run=XXX -bench=. $(go list ./crypto)
- run: make minicluster

nightly-build:
docker:
# specify the version
- image: iotex/iotex-core-ci:latest

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
build_test_darwin:
macos:
xcode: "10.2.0" # not supported > 10.2.0
working_directory: ~/go/src/github.com/iotexproject/iotex-core

#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /go/src/github.com/iotexproject/iotex-core
steps:
- checkout

# specify any bash command here prefixed with `run: `
- run: make nightlybuild
- run: cd cli/ioctl/ && sh buildcli.sh
- run: sudo apt install awscli
- run:
name: Deploy to S3
command: aws s3 cp release/* ${S3_BUCKET_DIR}
name: install golang 1.11.6
command: |
curl -o go1.11.6.darwin-amd64.tar.gz https://dl.google.com/go/go1.11.6.darwin-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.6.darwin-amd64.tar.gz
- run:
name: SET GO ENV AND go.test.sh
command: |
export GOPATH=~/go
export GOROOT="/usr/local/go"
export LD_LIBRARY_PATH=:~/go/src/github.com/iotexproject/iotex-core/crypto/lib
export PATH=$PATH:$GOPATH/bin:$PATH:$GOROOT/bin
./go.test.sh
bash <(curl -s https://codecov.io/bash)
go test -run=XXX -bench=. $(go list ./crypto)
make minicluster
test_macos_build:
macos:
xcode: "10.2.0" # not supported > 10.2.0
build_test_ubuntu:
machine:
image: circleci/classic:latest
working_directory: ~/go/src/github.com/iotexproject/iotex-core

steps:
- checkout

- run:
name: Install golang / dep
name: clean go 1.9 update golang 1.11.6
command: |
brew install golang
wget https://dl.google.com/go/go1.11.6.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -zxf go1.11.6.linux-amd64.tar.gz
- run:
name: SET GO ENV

name: SET GO ENV AND go.test.sh
command: |
export GOROOT="/usr/local/go"
export GOPATH=~/go
export GOROOT="$(brew --prefix golang)/libexec"
export LD_LIBRARY_PATH=:~/go/src/github.com/iotexproject/iotex-core/crypto/lib
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
set -e
for d in $(go list ./... | grep -v 'vendor\|protocol/vote'); do
go test -short -v -coverprofile=profile.out -covermode=count "$d"
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
export LD_LIBRARY_PATH=:"/home/circleci/go/src/github.com/iotexproject/iotex-core/crypto/lib"
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
./go.test.sh
bash <(curl -s https://codecov.io/bash)
go test -run=XXX -bench=. $(go list ./crypto)
make minicluster
######################################################################
nightly_build_docker:
docker:
# specify the version
- image: iotex/iotex-core-ci:latest

working_directory: /go/src/github.com/iotexproject/iotex-core
steps:
- checkout
# specify any bash command here prefixed with `run: `
#- run: golint -set_exit_status $(go list ./... | grep -v /vendor/ | grep -v /explorer/idl/ | grep -v /api/idl/)
#- run: go env
#- run: dep ensure
#- run: ./go.test.sh
- run: bash <(curl -s https://codecov.io/bash)
- run: go test -run=XXX -bench=. $(go list ./crypto)
- run: make minicluster
- run: make nightlybuild

nightly_ioctl_build_docker:
docker:
# specify the version
- image: iotex/iotex-core-ci:latest

nightly-macos:
working_directory: /go/src/github.com/iotexproject/iotex-core
steps:
- checkout
- run: cd cli/ioctl/ && ./buildcli.sh
- run: sudo apt-get install python python-pip
- run: sudo pip install awscli
- run: aws s3 sync cli/ioctl/release/ ${S3_BUCKET_DIR}

nightly_ioctl_build_darwin:
macos:
xcode: "10.2.0" # not supported > 10.2.0
xcode: "10.2.0" # not supported > 10.2.0

working_directory: ~/go/src/github.com/iotexproject/iotex-core

steps:
- checkout
- run: cd cli/ioctl/ && sh buildcli.sh
- run: pip install awscli
- run:
name: Deploy to S3
command: aws s3 cp release/* ${S3_BUCKET_DIR}
name: install golang 1.11.6
command: |
curl -o go1.11.6.darwin-amd64.tar.gz https://dl.google.com/go/go1.11.6.darwin-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.6.darwin-amd64.tar.gz
- run:
name: SET GO ENV AND buildcli.sh
command: |
export GOPATH=~/go
export GOROOT="/usr/local/go"
export LD_LIBRARY_PATH=:~/go/src/github.com/iotexproject/iotex-core/crypto/lib
export PATH=$PATH:$GOPATH/bin:$PATH:$GOROOT/bin
cd cli/ioctl/ && ./buildcli.sh
sudo pip install awscli
aws s3 sync release/ ${S3_BUCKET_DIR}
workflows:
version: 2
commit:
jobs:
- build
- test_macos_build

- build_test_darwin
- build_test_docker

scheduled-workflow:
triggers:
- schedule:
Expand All @@ -121,5 +128,6 @@ workflows:
only:
- master
jobs:
- nightly-build
- nightly-macos
- nightly_build_docker
- nightly_ioctl_build_docker
- nightly_ioctl_build_darwin
2 changes: 1 addition & 1 deletion cli/ioctl/buildcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ cd $(dirname $0)
gofmt -w ./

CGO_ENABLED=1 GOARCH=amd64 go build -o $release_dir/$project_name-$OS-amd64 -v .
CGO_ENABLED=1 GOARCH=386 go build -o $release_dir/$project_name-$OS-386 -v .
#CGO_ENABLED=1 GOARCH=386 go build -o $release_dir/$project_name-$OS-386 -v .

0 comments on commit b1b2ffc

Please sign in to comment.