diff --git a/.circleci/config.yml b/.circleci/config.yml index cd5bde1a78..aaa930b6dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -121,5 +128,6 @@ workflows: only: - master jobs: - - nightly-build - - nightly-macos + - nightly_build_docker + - nightly_ioctl_build_docker + - nightly_ioctl_build_darwin diff --git a/cli/ioctl/buildcli.sh b/cli/ioctl/buildcli.sh index 9703d89ddb..686ca5b6f4 100755 --- a/cli/ioctl/buildcli.sh +++ b/cli/ioctl/buildcli.sh @@ -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 .