github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/.circleci/config.yml (about)

     1  sputnik_vm_steps: &sputnik_vm_steps
     2    steps:
     3      - restore_cache:
     4          key: v8-toolchain-{{ arch }}
     5      - attach_workspace:
     6          at: ~/
     7      - run:
     8          name: Compile SputnikVM-ffi
     9          command: |
    10            export GOPATH=$HOME/go
    11            export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
    12            cd $GOPATH/src/github.com/ethereumproject/go-ethereum
    13            make -C vendor/github.com/ETCDEVTeam/sputnikvm-ffi/c
    14      - persist_to_workspace:
    15          root: ~/
    16          paths:
    17            - go/src/github.com/ethereumproject/go-ethereum/vendor/github.com/ETCDEVTeam/sputnikvm-ffi/c/libsputnikvm.a
    18  
    19  deploy_steps: &deploy_steps
    20    steps:
    21      - restore_cache:
    22          key: v8-toolchain-{{ arch }}
    23      - attach_workspace:
    24          at: ~/
    25      - deploy:
    26          name: Deploy to builds.etcdevteam.com
    27          command: |
    28            if [[ $CIRCLE_PROJECT_USERNAME != ethereumproject ]]; then echo "Deployments only enabled from ethereumproject/ repo. Exiting." && exit 0; fi
    29            export GOPATH=$HOME/go
    30            export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
    31            cd $GOPATH/src/github.com/ethereumproject/go-ethereum
    32            cp $GOPATH/bin/geth ./
    33            export VERSION=`janus version -format TAG_OR_NIGHTLY`
    34            ./geth version | awk '/^Version: /{if (ENVIRON["VERSION"] != $2){printf "Expected: \"%s\", got \"%s\"\n",ENVIRON["VERSION"], $2; exit 1}}'
    35  
    36            ./scripts/deploy.sh gcloud-circleci.json.enc
    37  
    38  unit_tests_steps: &unit_tests_steps
    39    steps:
    40      - restore_cache:
    41          key: v8-toolchain-{{ arch }}
    42      - attach_workspace:
    43          at: ~/
    44      - run:
    45          name: Run unit tests
    46          command: |
    47            export GOPATH=$HOME/go
    48            export GOBIN=$GOPATH/bin
    49            export PATH=$PATH:$GOBIN
    50            export TAGS="netgo deterministic"
    51            if [ $USE_SPUTNIK_VM == true ]; then
    52              export CGO_LDFLAGS="$GOPATH/src/github.com/ethereumproject/go-ethereum/vendor/github.com/ETCDEVTeam/sputnikvm-ffi/c/libsputnikvm.a -ldl"
    53              if [ "$(uname)" == "Darwin" ]; then
    54                export CGO_LDFLAGS="$CGO_LDFLAGS -lresolv"
    55              fi
    56              export TAGS="sputnikvm $TAGS"
    57            fi
    58            export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
    59            cd $GOPATH/src/github.com/ethereumproject/go-ethereum
    60            go env
    61            # Since core/ and tests/ packages are run deterministically, we can safely
    62            # infer that SputnikVM is functioning the same as the native VM without running
    63            # the schroedinger nondeterministic tests with sputnik enabled.
    64            go test -ldflags "-X github.com/ethereumproject/go-ethereum/core.UseSputnikVM=$USE_SPUTNIK_VM" -tags="$TAGS" ./...
    65            schroedinger -t 5 -f ./schroedinger-tests.txt
    66  
    67  bats_tests_steps: &bats_tests_steps
    68      steps:
    69        - restore_cache:
    70            key: v8-toolchain-{{ arch }}
    71        - attach_workspace:
    72            at: ~/
    73        - run:
    74            name: Run bats tests
    75            command: |
    76              export GOPATH=$HOME/go
    77              export CGO_LDFLAGS="$GOPATH/src/github.com/ethereumproject/go-ethereum/vendor/github.com/ETCDEVTeam/sputnikvm-ffi/c/libsputnikvm.a -ldl"
    78              if [ "$(uname)" == "Darwin" ]; then
    79                export CGO_LDFLAGS="$CGO_LDFLAGS -lresolv"
    80              else
    81                export EXT_LD_FLAGS="-extldflags=-static"
    82              fi
    83              export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin:$HOME/bin
    84              cd $GOPATH/src/github.com/ethereumproject/go-ethereum
    85              # go install ... doesn't work with netgo on CircleCI on Linux
    86              go build -tags="sputnikvm netgo" -ldflags "$EXT_LD_FLAGS -X main.Version=`janus version -format TAG_OR_NIGHTLY`" ./cmd/geth
    87              mkdir -p $GOPATH/bin
    88              mv ./geth $GOPATH/bin/
    89              bats tests/bats
    90        - persist_to_workspace:
    91            root: ~/
    92            paths:
    93                - go/*
    94  
    95  version: 2
    96  jobs:
    97    mac_env_setup:
    98      macos:
    99        xcode: "9.0"
   100      steps:
   101        - restore_cache:
   102            key: v8-toolchain-{{ arch }}
   103        - run:
   104            name: Prepare directories
   105            command: |
   106              export GOPATH=$HOME/go
   107              export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
   108              mkdir -p $GOPATH/src/github.com/ethereumproject
   109        - checkout:
   110            path:  ~/go/src/github.com/ethereumproject/go-ethereum
   111        - run:
   112            name: Install required software
   113            command: |
   114              export GOPATH=$HOME/go
   115              export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin]
   116              curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
   117              if [ ! -x ~/janusbin/janus ]; then
   118                cd $HOME; curl -sL https://raw.githubusercontent.com/ethereumproject/janus/master/get.sh | bash
   119                brew update
   120                export BDIR="$(brew --repo homebrew/core)" && echo "$BDIR" && git -C "$BDIR" reset --hard master && git -C "$BDIR" fetch origin ac2308d7640e45de0de1dbcbb6d4f42fcdd8adde && git -C "$BDIR" checkout FETCH_HEAD && HOMEBREW_NO_AUTO_UPDATE=1 brew install go && brew switch go 1.9.3 && git -C "$BDIR" checkout master && unset BDIR
   121                brew info go
   122                go version
   123                brew install bats
   124                brew install gpg2
   125                go get github.com/etcdevteam/go-schroedinger/cmd/schroedinger/...
   126              fi
   127        - persist_to_workspace:
   128            root: ~/
   129            paths:
   130              - go/src/github.com/ethereumproject/*
   131        - save_cache:
   132            key: v8-toolchain-{{ arch }}
   133            paths:
   134              - /usr/local/bin/bats
   135              - /usr/local/bin/go
   136              - /usr/local/bin/godoc
   137              - /usr/local/bin/gofmt
   138              - /usr/local/bin/gpg
   139              - /usr/local/opt
   140              - /usr/local/Cellar
   141              - /usr/local/Homebrew
   142              - ~/.cargo
   143              - ~/.rustup
   144              - ~/janusbin
   145              - ~/go/bin
   146  
   147    linux_env_setup:
   148      docker:
   149        - image: circleci/golang:1.9
   150      steps:
   151        - restore_cache:
   152            key: v8-toolchain-{{ arch }}
   153        - run:
   154            name: Prepare directories
   155            command: |
   156              export GOPATH=$HOME/go
   157              export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
   158              mkdir -p $GOPATH/src/github.com/ethereumproject
   159        - checkout:
   160            path:  ~/go/src/github.com/ethereumproject/go-ethereum
   161        - run:
   162            name: Install required software
   163            command: |
   164              export GOPATH=$HOME/go
   165              export PATH=$PATH:$HOME/.cargo/bin:$HOME/janusbin
   166              git clone https://github.com/sstephenson/bats.git
   167              cd bats
   168              sudo ./install.sh ~/
   169              curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
   170              if [ ! -x ~/janusbin/janus ]; then
   171                cd $HOME; curl -sL https://raw.githubusercontent.com/ethereumproject/janus/master/get.sh | bash
   172              fi
   173              go get github.com/etcdevteam/go-schroedinger/cmd/schroedinger/...
   174        - persist_to_workspace:
   175            root: ~/
   176            paths:
   177              - go/src/github.com/ethereumproject/*
   178        - save_cache:
   179            key: v8-toolchain-{{ arch }}
   180            paths:
   181              - ~/bin
   182              - ~/libexec
   183              - ~/.cargo
   184              - ~/.rustup
   185              - ~/janusbin
   186              - ~/go/bin
   187  
   188    mac_sputnik_vm:
   189      macos:
   190        xcode: "9.0"
   191      <<: *sputnik_vm_steps
   192  
   193    linux_sputnik_vm:
   194      docker:
   195        - image: circleci/golang:1.9
   196      <<: *sputnik_vm_steps
   197  
   198    mac_evm_unit_tests:
   199      macos:
   200        xcode: "9.0"
   201      environment:
   202          USE_SPUTNIK_VM: false
   203      <<: *unit_tests_steps
   204  
   205    linux_evm_unit_tests:
   206      docker:
   207        - image: circleci/golang:1.9
   208      environment:
   209          GOMAXPROCS: 2
   210          USE_SPUTNIK_VM: false
   211      <<: *unit_tests_steps
   212  
   213    mac_sputnikvm_unit_tests:
   214      macos:
   215        xcode: "9.0"
   216      environment:
   217          USE_SPUTNIK_VM: true
   218      <<: *unit_tests_steps
   219  
   220    linux_sputnikvm_unit_tests:
   221      docker:
   222        - image: circleci/golang:1.9
   223      environment:
   224          GOMAXPROCS: 2
   225          USE_SPUTNIK_VM: true
   226      <<: *unit_tests_steps
   227  
   228    mac_bats_tests:
   229      macos:
   230        xcode: "9.0"
   231      <<: *bats_tests_steps
   232  
   233    linux_bats_tests:
   234      docker:
   235        - image: circleci/golang:1.9
   236      <<: *bats_tests_steps
   237  
   238    mac_deploy:
   239      macos:
   240        xcode: "9.0"
   241      <<: *deploy_steps
   242  
   243    linux_deploy:
   244      docker:
   245        - image: circleci/golang:1.9
   246      <<: *deploy_steps
   247  
   248  workflows:
   249    version: 2
   250    mac_build:
   251      jobs:
   252        - mac_env_setup:
   253            filters:
   254              tags:
   255                only: /.*/
   256        - mac_sputnik_vm:
   257            requires:
   258              - mac_env_setup
   259            filters:
   260              tags:
   261                only: /.*/
   262        - mac_evm_unit_tests:
   263            requires:
   264              - mac_env_setup
   265            filters:
   266              tags:
   267                only: /.*/
   268        - mac_sputnikvm_unit_tests:
   269            requires:
   270              - mac_sputnik_vm
   271            filters:
   272              tags:
   273                only: /.*/
   274        - mac_bats_tests:
   275            requires:
   276              - mac_sputnik_vm
   277            filters:
   278              tags:
   279                only: /.*/
   280        - mac_deploy:
   281            requires:
   282              - mac_evm_unit_tests
   283              - mac_sputnikvm_unit_tests
   284              - mac_bats_tests
   285            filters:
   286              branches:
   287                only: master
   288              tags:
   289                only: /.*/
   290  
   291    linux_build:
   292      jobs:
   293        - linux_env_setup:
   294            filters:
   295              tags:
   296                only: /.*/
   297        - linux_sputnik_vm:
   298            requires:
   299              - linux_env_setup
   300            filters:
   301              tags:
   302                only: /.*/
   303        - linux_evm_unit_tests:
   304            requires:
   305              - linux_env_setup
   306            filters:
   307              tags:
   308                only: /.*/
   309        - linux_sputnikvm_unit_tests:
   310            requires:
   311              - linux_sputnik_vm
   312            filters:
   313              tags:
   314                only: /.*/
   315        - linux_bats_tests:
   316            requires:
   317              - linux_sputnik_vm
   318            filters:
   319              tags:
   320                only: /.*/
   321        - linux_deploy:
   322            requires:
   323              - linux_evm_unit_tests
   324              - linux_sputnikvm_unit_tests
   325              - linux_bats_tests
   326            filters:
   327              branches:
   328                only: master
   329              tags:
   330                only: /.*/