2020-01-25 19:51:23 +01:00
|
|
|
version: 2
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
workflow:
|
|
|
|
jobs:
|
|
|
|
- build
|
2020-01-26 16:04:14 +01:00
|
|
|
- lint
|
2020-01-29 15:23:58 +01:00
|
|
|
- faucet_docker
|
2020-02-03 09:11:13 +01:00
|
|
|
- test
|
2020-01-25 19:51:23 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:10
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Version information
|
|
|
|
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
|
|
|
|
- restore_cache:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Restore Yarn Package Cache
|
2020-01-25 19:51:23 +01:00
|
|
|
keys:
|
2020-01-29 17:10:21 +01:00
|
|
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
2020-01-25 19:51:23 +01:00
|
|
|
- run:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Install Dependencies
|
|
|
|
command: yarn install --frozen-lockfile
|
2020-01-25 19:51:23 +01:00
|
|
|
- save_cache:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Save Yarn Package Cache
|
|
|
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
2020-01-25 19:51:23 +01:00
|
|
|
paths:
|
2020-01-29 17:10:21 +01:00
|
|
|
- ~/.cache/yarn
|
2020-01-25 19:51:23 +01:00
|
|
|
- run:
|
|
|
|
command: yarn build
|
2020-02-03 08:55:59 +01:00
|
|
|
test:
|
2020-02-03 12:45:49 +01:00
|
|
|
machine:
|
|
|
|
# We can't use a containerized environment since it requires remote docker to start custom containers.
|
|
|
|
# However, we can't access the remote docker's network from the primary container. This is a
|
|
|
|
# feature, as documented in https://circleci.com/docs/2.0/building-docker-images/#separation-of-environments
|
|
|
|
# As a consequence, we cannot use the circleci CLI for this job because "You cannot use the machine
|
|
|
|
# executor in local jobs." (https://circleci.com/docs/2.0/local-cli/#limitations-of-running-jobs-locally)
|
|
|
|
image: ubuntu-1604:201903-01
|
2020-02-03 08:55:59 +01:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Version information
|
|
|
|
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
|
2020-02-03 09:11:13 +01:00
|
|
|
- run: # start early for less wait time below
|
2020-02-03 09:44:30 +01:00
|
|
|
command: ./scripts/cosm/start.sh
|
2020-02-03 09:11:13 +01:00
|
|
|
background: true
|
2020-02-03 08:55:59 +01:00
|
|
|
- restore_cache:
|
|
|
|
name: Restore Yarn Package Cache
|
|
|
|
keys:
|
|
|
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
2020-01-26 15:54:47 +01:00
|
|
|
- run:
|
2020-02-03 08:55:59 +01:00
|
|
|
name: Install Dependencies
|
|
|
|
command: yarn install --frozen-lockfile
|
|
|
|
- save_cache:
|
|
|
|
name: Save Yarn Package Cache
|
|
|
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
|
|
|
paths:
|
|
|
|
- ~/.cache/yarn
|
2020-02-03 09:47:56 +01:00
|
|
|
- run: # wait until cosm scripts have fully started (this includes time for docker pull)
|
|
|
|
command: timeout 60 bash -c "until curl -s http://localhost:1317/node_info > /dev/null; do sleep 1; done"
|
2020-02-03 08:55:59 +01:00
|
|
|
- run:
|
2020-02-03 09:29:15 +01:00
|
|
|
environment:
|
|
|
|
COSMOS_ENABLED: 1
|
2020-01-26 15:54:47 +01:00
|
|
|
command: yarn test
|
2020-02-03 08:55:59 +01:00
|
|
|
- run:
|
2020-02-03 09:44:30 +01:00
|
|
|
command: ./scripts/cosm/stop.sh
|
2020-01-26 16:04:14 +01:00
|
|
|
lint:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:10
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Version information
|
|
|
|
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
|
|
|
|
- restore_cache:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Restore Yarn Package Cache
|
2020-01-26 16:04:14 +01:00
|
|
|
keys:
|
2020-01-29 17:10:21 +01:00
|
|
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
2020-01-26 16:04:14 +01:00
|
|
|
- run:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Install Dependencies
|
|
|
|
command: yarn install --frozen-lockfile
|
2020-01-26 16:04:14 +01:00
|
|
|
- save_cache:
|
2020-01-29 17:10:21 +01:00
|
|
|
name: Save Yarn Package Cache
|
|
|
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
2020-01-26 16:04:14 +01:00
|
|
|
paths:
|
2020-01-29 17:10:21 +01:00
|
|
|
- ~/.cache/yarn
|
2020-01-26 16:04:14 +01:00
|
|
|
- run:
|
|
|
|
command: yarn lint
|
2020-01-29 15:23:58 +01:00
|
|
|
faucet_docker:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:10
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker:
|
|
|
|
docker_layer_caching: true
|
|
|
|
- run:
|
|
|
|
name: Build docker image
|
|
|
|
command: docker build -t cosmwasm/faucet:manual --file faucet.Dockerfile .
|
|
|
|
- run:
|
|
|
|
name: Test docker image
|
|
|
|
command: |
|
|
|
|
docker run --read-only --rm cosmwasm/faucet:manual help
|
|
|
|
docker run --read-only --rm cosmwasm/faucet:manual version
|