Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 67 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,75 @@
version: 2

jobs:
build:
checkout_and_compile:
docker:
- image: circleci/node:9.6.1
working_directory: ~/set-protocol-contracts
steps:
- checkout
- run: yarn
- run:
name: testrpc
- checkout
- restore_cache:
key: module-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Fetch Dependencies
command: yarn install
- run:
name: Transpile Contracts
command: yarn prepare-test
- save_cache:
key: module-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- save_cache:
key: compiled-env-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/set-protocol-contracts
test:
docker:
- image: circleci/node:9.6.1
working_directory: ~/set-protocol-contracts
parallelism: 2
steps:
- restore_cache:
key: compiled-env-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Test RPC
command: yarn chain
background: true
- run: yarn test
- run: npm run coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls
- run:
name: Truffle Test
command: |
mkdir /tmp/test-results
TEST_FILES="$(circleci tests glob "./transpiled/**/*.spec.js" | circleci tests split --split-by=timings)"
yarn test-continuous ${TEST_FILES}
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results

coverage:
docker:
- image: circleci/node:9.6.1
working_directory: ~/set-protocol-contracts
steps:
- restore_cache:
key: compiled-env-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Test RPC
command: yarn chain
background: true
- run:
name: Coverage
command: npm run coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls

workflows:
version: 2
build-and-test:
jobs:
- checkout_and_compile
- test:
requires:
- checkout_and_compile
- coverage:
requires:
- checkout_and_compile

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"clean": "rm -rf build; rm -rf transpiled; rm -rf types/generated",
"compile": "truffle compile",
"prepare-test": "yarn clean && truffle compile --all && yarn run generate-typings && yarn run transpile",
"test": "yarn prepare-test && truffle test `find ./transpiled/test -name '*.spec.js'`",
"test": "yarn prepare-test && truffle test `find transpiled/test -name '*.spec.js'`",
"test-continuous": "truffle test",
"transpile": "tsc",
"generate-typings": "abi-gen --abis './build/contracts/*.json' --out './types/generated' --template './types/contract_templates/contract.mustache' --partials './types/contract_templates/partials/*.mustache' && yarn run rename-generated-abi",
"rename-generated-abi": "mv types/generated/detailed_e_r_c20.ts types/generated/detailed_erc20.ts && mv types/generated/e_r_c20_basic.ts types/generated/erc20_basic.ts",
Expand All @@ -34,7 +35,7 @@
"chain": "yarn clean-chain && ganache-cli --db blockchain --networkId 50 --accounts 20 -l 10000000 -e 1000000 -m 'concert load couple harbor equip island argue ramp clarify fence smart topic'",
"coverage-setup": "cp -r transpiled/test/* test/. && cp -r transpiled/types/* types/.",
"coverage-cleanup": "find test -name \\*.js* -type f -delete && find types -name \\*.js* -type f -delete",
"coverage": "yarn prepare-test && yarn coverage-setup && ./node_modules/.bin/solidity-coverage && yarn coverage-cleanup"
"coverage": "yarn coverage-setup && ./node_modules/.bin/solidity-coverage && yarn coverage-cleanup"
},
"repository": "git@github.com:SetProtocol/set-protocol-contracts.git",
"author": "Felix Feng <felix@setprotocol.com>",
Expand Down
3 changes: 1 addition & 2 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ console.log("mnemonic", mnemonic);
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 10000
enabled: true
}
},
networks: {
Expand Down