Skip to content
Open
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
221 changes: 26 additions & 195 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,195 +1,26 @@
version: 2.1

orbs:
codecov: codecov/[email protected]

jobs:
test:
docker:
- image: circleci/node:13
working_directory: ~/repo
steps:
- run:
|
sudo wget https://github.com/ethereum/solidity/releases/download/v0.8.10/solc-static-linux -O /usr/local/bin/solc
sudo chmod +x /usr/local/bin/solc
- checkout
- restore_cache:
keys:
- v3-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- v3-scenario/dependencies-{{ checksum "scenario/yarn.lock" }}
- restore_cache:
keys:
- v3-solcache
- restore_cache:
keys:
- v3-scencache
- run: yarn install || (yarn cache clean && yarn install)
- run: cd scenario && (yarn install || (yarn cache clean && yarn install))
- save_cache:
paths:
- node_modules
key: v3-dependencies-{{ checksum "yarn.lock" }}
- save_cache:
paths:
- scenario/node_modules
key: v3-scenario-dependencies-{{ checksum "scenario/yarn.lock" }}
- attach_workspace:
at: ~/repo
- run: mkdir ~/junit
- run: ./script/build_scenarios
- run:
shell: /bin/bash -eox pipefail -O globstar
name: yarn test
command: NODE_OPTIONS="--max-old-space-size=12228" JEST_JUNIT_OUTPUT_DIR=~/junit JEST_JUNIT_OUTPUT_NAME=test-results.xml yarn test $(circleci tests glob 'tests/**/**Test.js' | circleci tests split --split-by=timings)
- save_cache:
paths:
- .build
- .solcache
key: v3-solcache
- save_cache:
paths:
- scenario/.tsbuilt
- .scencache
key: v3-scencache
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
parallelism: 3
resource_class: xlarge

verify:
docker:
- image: compoundfinance/alpine-java-z3:latest
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo
- run: script/verify
parallelism: 4

coverage:
docker:
- image: circleci/node:13
working_directory: ~/repo
steps:
- run:
|
sudo wget https://github.com/ethereum/solidity/releases/download/v0.8.10/solc-static-linux -O /usr/local/bin/solc
sudo chmod +x /usr/local/bin/solc
- checkout
- restore_cache:
keys:
- v3-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- v3-scenario-dependencies-{{ checksum "scenario/yarn.lock" }}
- restore_cache:
keys:
- v3-solcache
- restore_cache:
keys:
- v3-scencache
- run: yarn install || (yarn cache clean && yarn install)
- run: cd scenario && (yarn install || (yarn cache clean && yarn install))
- save_cache:
paths:
- node_modules
key: v3-dependencies-{{ checksum "yarn.lock" }}
- save_cache:
paths:
- scenario/node_modules
key: v2-scenario-dependencies-{{ checksum "scenario/package.json" }}
- attach_workspace:
at: ~/repo
- run: mkdir ~/junit
- run: ./script/build_scenarios
- run:
shell: /bin/bash -eox pipefail -O globstar
name: yarn test
no_output_timeout: 30m
command: NODE_OPTIONS="--max-old-space-size=12228" JEST_JUNIT_OUTPUT_DIR=~/junit JEST_JUNIT_OUTPUT_NAME=test-results.xml script/coverage $(circleci tests glob 'tests/**/**Test.js' | circleci tests split --split-by=timings) -- --maxWorkers=4
- save_cache:
paths:
- .build
- .solcachecov
key: v3-solcache
- save_cache:
paths:
- scenario/.tsbuilt
- .scencache
key: v3-scencache
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/repo/coverage/coverage-final.json
destination: coverage-final.json
- store_artifacts:
path: ~/repo/coverage/lcov-report
destination: coverage
- codecov/upload:
file: ~/repo/coverage/coverage-final.json
parallelism: 10
resource_class: xlarge

lint:
docker:
- image: circleci/node:13
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v3-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install || (yarn cache clean && yarn install)
- save_cache:
paths:
- node_modules
key: v3-dependencies-{{ checksum "yarn.lock" }}
- attach_workspace:
at: ~/repo
- run: yarn run lint

docker:
docker:
- image: cimg/go:1.13
steps:
- run: |
if [ -z "$DOCKER_USER" -o -z "$DOCKER_PASS" -o -z "$DOCKER_REPO" ]; then
echo "No DOCKER_REPO, DOCKER_USER or DOCKER_PASS, skipping Docker build..."
circleci-agent step halt
fi
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run: |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin

set -x

IMAGE_NAME=${CIRCLE_PROJECT_USERNAME/-/}/$CIRCLE_PROJECT_REPONAME
COMMIT_TAG=$(git rev-parse --short HEAD)
docker build -t $IMAGE_NAME:$COMMIT_TAG .
docker push $IMAGE_NAME:$COMMIT_TAG

if [ -n "$CIRCLE_TAG" ]; then
docker build -t $IMAGE_NAME:$CIRCLE_TAG .
docker push $IMAGE_NAME:$CIRCLE_TAG
fi

workflows:
version: 2
build-test-and-deploy:
jobs:
- test
- coverage
- lint
- verify
- docker:
filters:
tags:
only: /^v.*/
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference

version: 2.1
executors:
my-custom-executor:
docker:
- image: cimg/base:stable
auth:
# ensure you have first added these secrets
# visit app.circleci.com/settings/project/github/Dargon789/foundry/environment-variables
username: $DOCKER_HUB_USER
password: $DOCKER_HUB_PASSWORD
jobs:
web3-defi-game-project-:

executor: my-custom-executor
steps:
- checkout
- run: |
# echo Hello, World!

workflows:
my-custom-workflow:
jobs:
- web3-defi-game-project-