tokenbridge/.circleci/config.yml
Przemyslaw Rzad 414fe9cb65
Ultimate e2e - Native to erc - UI (#168)
* Trying job

* dependency

* Run the tests

* Oracle docker composes

* Fixed networks

* endpoints

* Skip logging

* Try node

* Moved chromedriver from ui to ui-e2e

* Port

* Run

* Install chrome

* minte blocks

* Finishing

* Revert "Skip logging"

76747eb7efd2ba3c93deedc62caca91a374357eb

* inventory

* Inventory change.

* ui-e2e fix

* ui-e2e fix?

* native-to-erc group

* jobs

* Ports

* Blocks

* yarn

* fix

* fix

* killall

* Try ui-e2e

* no killall

* All jobs.

* Try two

* separate jobs

* all jobs

* One job.

* Removed the oracle-e2e step in ultimate tests.
2019-08-01 09:57:58 +02:00

221 lines
7.1 KiB
YAML

version: 2
jobs:
initialize:
docker:
- image: circleci/node:10.15
steps:
- checkout
- run: git submodule update --init
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run: git submodule status > submodule.status
- restore_cache:
name: Restore contracts submodule with compiled contracts
keys:
- contracts-{{ checksum "submodule.status" }}
- run: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run: touch install_deploy.log; test -d contracts/build/contracts || yarn install:deploy &> install_deploy.log
- store_artifacts:
path: install_deploy.log
- run: test -d contracts/build/contracts || yarn compile:contracts
- save_cache:
name: Save contracts submodule with compiled contracts
key: contracts-{{ checksum "submodule.status" }}
paths:
- contracts
- save_cache:
name: Save initialized project for subsequent jobs
key: initialize-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/project
initialize-root:
docker:
- image: circleci/node:10.15
steps:
- checkout
- run: sudo su - -c 'export CI=true && cd /home/circleci/project && yarn initialize && yarn test'
build:
docker:
- image: circleci/node:10.15
steps:
- restore_cache:
key: initialize-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn run build
lint:
docker:
- image: circleci/node:10.15
steps:
- restore_cache:
key: initialize-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn run lint
test:
docker:
- image: circleci/node:10.15
steps:
- restore_cache:
key: initialize-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn run test
oracle-e2e:
docker:
- image: circleci/node:10.15
steps:
- checkout
- run: git submodule update --init
- setup_remote_docker:
docker_layer_caching: true
- run: yarn run oracle-e2e
ui-e2e:
machine:
image: circleci/classic:latest
docker_layer_caching: true
steps:
- checkout
- run: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run: nvm install 11.4.0 && nvm alias default 11.4.0
- run: curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- run: echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- run: sudo apt-get update && sudo apt-get install yarn
- run: wget -O chrome.deb https://www.slimjet.com/chrome/download-chrome.php?file=files%2F75.0.3770.80%2Fgoogle-chrome-stable_current_amd64.deb
- run: sudo dpkg -i chrome.deb
- run: git submodule update --init
- restore_cache:
name: Restore Machine Yarn Package Cache
keys:
- yarn-machine-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- save_cache:
name: Save Machine Yarn Package Cache
key: yarn-machine-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run: yarn run ui-e2e
monitor-e2e:
machine:
image: circleci/classic:latest
docker_layer_caching: true
steps:
- checkout
- run: git submodule update --init
- run: ./monitor-e2e/run-tests.sh
cover:
docker:
- image: circleci/node:10.15
steps:
- restore_cache:
key: initialize-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn workspace ui run coverage
- run: yarn workspace ui run coveralls
deployment-oracle:
machine:
image: circleci/classic:latest
docker_layer_caching: true
steps:
- checkout
- run: deployment/molecule/molecule.sh oracle
deployment-ui:
machine:
image: circleci/classic:latest
docker_layer_caching: true
steps:
- checkout
- run: deployment/molecule/molecule.sh ui
ultimate-native-to-erc:
machine:
image: circleci/classic:latest
docker_layer_caching: true
steps:
- checkout
- run: git submodule update --init
- run:
name: Install redis tools
command: sudo apt-get install -y redis-tools
- run:
name: Install node
command: |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install v10.15.3
nvm alias default v10.15.3
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
- run:
name: Install Chrome
command: |
wget -O chrome.deb https://www.slimjet.com/chrome/download-chrome.php?file=files%2F75.0.3770.80%2Fgoogle-chrome-stable_current_amd64.deb
sudo dpkg -i chrome.deb
- run:
name: Install yarn
command: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
- run:
name: Install npm packages
command: nvm use default; yarn install --frozen-lockfile
- run:
name: Prepare the infrastructure
command: e2e-commons/up.sh deploy native-to-erc
no_output_timeout: 30m
- run:
name: Wait for the Oracle to start
command: |
set +e
i=0
while [[ $(redis-cli GET native-erc-collected-signatures:lastProcessedBlock) = "" ]]; do
((i++))
if [ "$i" -gt 30 ]
then
exit -1
fi
echo "Sleeping..."
sleep 3
done
- run:
name: Run the ui-e2e tests
command: |
nvm use default;
node ./e2e-commons/scripts/blocks.js &
cd ui-e2e; yarn mocha -g "NATIVE TO ERC" -b ./test.js
workflows:
version: 2
tokenbridge:
jobs:
- initialize
- initialize-root:
filters:
branches:
only: master
- build:
requires:
- initialize
- lint:
requires:
- initialize
- test:
requires:
- initialize
- cover:
requires:
- initialize
filters:
branches:
only: master
- oracle-e2e
- ui-e2e
- monitor-e2e
- deployment-oracle
- deployment-ui
- ultimate-native-to-erc