From 9212bfb24257365b9bb32393ca88b7153c615453 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Tue, 9 Jul 2019 18:16:31 -0700 Subject: [PATCH] Add E2E CI script: colonyNetwork --- .circleci/config.yml | 77 ++++++++++++++++++++++++++++------------- scripts/run-colony.sh | 28 +++++++++++++++ scripts/run-zeppelin.sh | 8 +++++ 3 files changed, 88 insertions(+), 25 deletions(-) create mode 100755 scripts/run-colony.sh create mode 100755 scripts/run-zeppelin.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 040815f..23cf69b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,27 +1,54 @@ version: 2.0 jobs: - build: - docker: - - image: circleci/node:8.15.0 - steps: - - checkout - - run: - name: Delete any old node_modules - command: | - rm -rf node_modules/ - - run: - name: Install dependencies - command: | - yarn - - run: - name: Get submodules - command: | - git submodule update --init - - run: - name: Run tests - command: | - npm run test-cov - - run: - name: Upload coverage - command: | - bash <(curl -s https://codecov.io/bash) + unit-test: + docker: + - image: circleci/node:8.15.0 + steps: + - checkout + - run: + name: Delete any old node_modules + command: | + rm -rf node_modules/ + - run: + name: Install dependencies + command: | + yarn + - run: + name: Get submodules + command: | + git submodule update --init + - run: + name: Run tests + command: | + npm run test-cov + - run: + name: Upload coverage + command: | + bash <(curl -s https://codecov.io/bash) + e2e-colony: + docker: + - image: circleci/node:10.12-stretch + working_directory: ~/colonyNetwork + steps: + - checkout + - run: + name: ColonyNetwork E2E + command: | + ./scripts/run-colony.sh + e2e-zeppelin: + docker: + - image: circleci/node:10.12-stretch + steps: + - checkout + - run: + name: OpenZeppelin E2E + command: | + ./scripts/run-zeppelin.sh + +workflows: + version: 2 + build: + jobs: + - unit-test + - e2e-colony + - e2e-zeppelin diff --git a/scripts/run-colony.sh b/scripts/run-colony.sh new file mode 100755 index 0000000..6adfeab --- /dev/null +++ b/scripts/run-colony.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# E2E CI: installs PR candidate on colonyNetwork and runs coverage +# + +set -o errexit + +# Get path to PR branch +PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_BRANCH" | sed 's/git@github.com:/https:\/\/github.com\//') +echo "Installing $PR_PATH" + +# Setup +sudo npm install -g yarn +git clone https://github.com/JoinColony/colonyNetwork.git +cd colonyNetwork || exit + +# Swap installed coverage for PR branch version +sudo yarn +sudo yarn remove -W solidity-coverage --dev +sudo yarn add -W "$PR_PATH" --dev + +git submodule update --init +sed -i 's/docker: true,/ /g' truffle.js +sudo yarn run provision:token:contracts +sudo yarn run test:contracts:coverage + +# Trick to 'allowFailure' on CIRCLE +set -o errexit diff --git a/scripts/run-zeppelin.sh b/scripts/run-zeppelin.sh new file mode 100755 index 0000000..35847d7 --- /dev/null +++ b/scripts/run-zeppelin.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# E2E CI: installs PR candidate on openzeppelin-solidity and runs coverage +# + +set -o errexit +echo "Installing --> $CIRCLE_REPOSITORY_URL#$CIRCLE_BRANCH" +set -o errexit \ No newline at end of file