319 lines
12 KiB
YAML
319 lines
12 KiB
YAML
version: 2.1
|
|
|
|
parameters:
|
|
cache_version:
|
|
type: string
|
|
default: v4
|
|
|
|
jobs:
|
|
build:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
environment:
|
|
NODE_OPTIONS: "--max-old-space-size=16384"
|
|
steps:
|
|
- checkout
|
|
- run: git submodule update --init --recursive
|
|
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_BRANCH }}
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- run:
|
|
name: install-yarn
|
|
command: npm install --force --global yarn@1.22.0
|
|
- run:
|
|
name: yarn
|
|
command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
|
|
- setup_remote_docker
|
|
- run: yarn build:ci
|
|
- save_cache:
|
|
key: cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
paths:
|
|
- ~/project/contracts/erc20/node_modules
|
|
- ~/project/contracts/test-utils/node_modules
|
|
- ~/project/contracts/treasury/node_modules
|
|
- ~/project/contracts/utils/node_modules
|
|
- ~/project/contracts/zero-ex/node_modules
|
|
- ~/project/node_modules
|
|
- ~/project/packages/asset-swapper/node_modules
|
|
- ~/project/packages/contract-addresses/node_modules
|
|
- ~/project/packages/contract-artifacts/node_modules
|
|
- ~/project/packages/contract-wrappers/node_modules
|
|
- ~/project/packages/protocol-utils/node_modules
|
|
- ~/.cache/yarn
|
|
- save_cache:
|
|
key: lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
paths:
|
|
- ~/project/contracts/erc20/lib/
|
|
- ~/project/contracts/test-utils/lib/
|
|
- ~/project/contracts/treasury/lib/
|
|
- ~/project/contracts/utils/lib/
|
|
- ~/project/contracts/zero-ex/lib/
|
|
- ~/project/packages/contract-addresses/lib/
|
|
- ~/project/packages/contract-artifacts/lib/
|
|
- ~/project/packages/contract-wrappers/lib/
|
|
- ~/project/packages/protocol-utils/lib/
|
|
- store_artifacts:
|
|
path: ~/repo/packages/abi-gen/test-cli/output
|
|
- store_artifacts:
|
|
path: ~/repo/packages/contract-wrappers/generated_docs
|
|
test-exchange-ganache:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: yarn wsrun -p @0x/contracts-exchange -m --serial -c test:circleci
|
|
test-integrations-ganache:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: yarn wsrun -p @0x/contracts-integrations -m --serial -c test:circleci
|
|
test-contracts-staking-ganache:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: yarn wsrun -p @0x/contracts-staking -m --serial -c test:circleci
|
|
test-contracts-extra-ganache:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: yarn wsrun -p @0x/contracts-exchange-forwarder -p @0x/contracts-coordinator -m --serial -c test:circleci
|
|
test-contracts-rest-ganache:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- run: |
|
|
git diff --name-only development >> changed.txt
|
|
if ! grep -q \.sol changed.txt; then
|
|
circleci-agent step halt
|
|
fi
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: |
|
|
yarn wsrun \
|
|
-p @0x/contracts-multisig \
|
|
-p @0x/contracts-utils \
|
|
-p @0x/contracts-exchange-libs \
|
|
-p @0x/contracts-erc20 \
|
|
-p @0x/contracts-erc721 \
|
|
-p @0x/contracts-erc1155 \
|
|
-p @0x/contracts-asset-proxy \
|
|
-p @0x/contracts-broker \
|
|
-p @0x/contracts-zero-ex \
|
|
-m --serial -c test:circleci
|
|
test-foundry:
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: ghcr.io/foundry-rs/foundry:latest
|
|
steps:
|
|
- checkout
|
|
- run: |
|
|
git diff --name-only development >> changed.txt
|
|
cat changed.txt
|
|
if ! grep -q \.sol changed.txt; then
|
|
circleci-agent step halt
|
|
fi
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run:
|
|
command: forge test
|
|
working_directory: ~/project/contracts/zero-ex
|
|
test-publish:
|
|
resource_class: large
|
|
environment:
|
|
NODE_OPTIONS: "--max-old-space-size=6442"
|
|
docker:
|
|
- image: node:16
|
|
- image: 0xorg/verdaccio
|
|
steps:
|
|
- checkout
|
|
- run: |
|
|
git diff --name-only development >> changed.txt
|
|
cat changed.txt
|
|
if ! grep -q packages/ changed.txt; then
|
|
circleci-agent step halt
|
|
fi
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run:
|
|
command: yarn test:publish:circleci
|
|
no_output_timeout: 1800
|
|
- store_artifacts:
|
|
path: ~/.npm/_logs
|
|
test-doc-generation:
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run:
|
|
command: yarn test:generate_docs:circleci
|
|
no_output_timeout: 1200
|
|
test-rest:
|
|
docker:
|
|
- image: node:16
|
|
environment:
|
|
RUST_ROUTER: "true"
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run: yarn wsrun -p @0x/contracts-test-utils -m --serial -c test:circleci
|
|
- run: yarn wsrun -p @0x/contract-addresses -m --serial -c test:circleci
|
|
- run: yarn wsrun -p @0x/contract-artifacts -m --serial -c test:circleci
|
|
- run: yarn wsrun -p @0x/contract-wrappers-test -m --serial -c test:circleci
|
|
- run: yarn wsrun -p @0x/order-utils -m --serial -c test:circleci
|
|
- save_cache:
|
|
key: coverage-contract-wrappers-test-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ~/repo/packages/contract-wrappers-test/coverage/lcov.info
|
|
- save_cache:
|
|
key: coverage-order-utils-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ~/repo/packages/order-utils/coverage/lcov.info
|
|
- save_cache:
|
|
key: coverage-web3-wrapper-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ~/repo/packages/web3-wrapper/coverage/lcov.info
|
|
static-tests:
|
|
resource_class: large
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- run:
|
|
command: yarn lerna run lint
|
|
- run:
|
|
command: yarn prettier:ci
|
|
- run:
|
|
command: yarn deps_versions:ci
|
|
- run:
|
|
command: yarn diff_md_docs:ci
|
|
submit-coverage:
|
|
docker:
|
|
- image: node:16
|
|
steps:
|
|
- restore_cache:
|
|
keys:
|
|
- cache-{{ checksum "yarn.lock" }}-<< pipeline.parameters.cache_version >>
|
|
- restore_cache:
|
|
keys:
|
|
- lib-{{ .Environment.CIRCLE_SHA1 }}
|
|
- restore_cache:
|
|
keys:
|
|
- coverage-contract-wrappers-test-{{ checksum "yarn.lock" }}
|
|
- restore_cache:
|
|
keys:
|
|
- coverage-order-utils-{{ checksum "yarn.lock" }}
|
|
- restore_cache:
|
|
keys:
|
|
- coverage-contracts-{{ checksum "yarn.lock" }}
|
|
- run: yarn report_coverage
|
|
workflows:
|
|
version: 2
|
|
main:
|
|
jobs:
|
|
- build
|
|
# Disabled until we begin actively developing on these packages again.
|
|
# - test-exchange-ganache:
|
|
# requires:
|
|
# - build
|
|
# - test-integrations-ganache:
|
|
# requires:
|
|
# - build
|
|
# - test-contracts-staking-ganache:
|
|
# requires:
|
|
# - build
|
|
# - test-contracts-extra-ganache:
|
|
# requires:
|
|
# - build
|
|
- test-foundry:
|
|
requires:
|
|
- build
|
|
- test-contracts-rest-ganache:
|
|
requires:
|
|
- build
|
|
- test-rest:
|
|
requires:
|
|
- build
|
|
- static-tests:
|
|
requires:
|
|
- build
|
|
- test-publish:
|
|
requires:
|
|
- build
|
|
- test-doc-generation:
|
|
requires:
|
|
- build
|
|
# Disabled until this repo has a coveralls API key
|
|
# - submit-coverage:
|
|
# requires:
|
|
# # Disabled until we begin actively developing on these packages again.
|
|
# # - test-exchange-ganache
|
|
# # - test-integrations-ganache
|
|
# # - test-contracts-staking-ganache
|
|
# # - test-contracts-extra-ganache
|
|
# - test-contracts-rest-ganache
|
|
# - test-rest
|
|
# - static-tests
|