54f6fb5835
* Renamed scenario default to oracle * Introduced ui molecule tests * Readme * Common prepare * Shared test_all * Moved test_docker_config to common * Added ui tests * Lint.
160 lines
4.8 KiB
YAML
160 lines
4.8 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 https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
- run: sudo dpkg -i google-chrome-stable_current_amd64.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
|
|
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
|