Skip to content

Commit

Permalink
fix(ci): run full CI suite on CircleCI
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Feb 22, 2020
1 parent 990f27c commit 47d22f8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 70 deletions.
91 changes: 21 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,40 @@
version: 2.1
jobs:
build:
# # Remove if parallelism is not desired
# parallelism: 2
# environment:
# # Configure the JVM and Gradle to avoid OOM errors
# _JAVA_OPTIONS: "-Xmx3g"
# GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
environment:
CI_CONTAINERS_WAIT_TIME: 60
machine:
image: ubuntu-1604:201903-01
resource_class: large
steps:
- checkout # check out source code to working directory
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
- run:
name: Setting up environment
command: |
cat /etc/os-release
sudo apt install -y util-linux
java -version
lscpu || true
source /opt/circleci/.nvm/nvm.sh
nvm install 8.17
nvm alias default 8.17
node -v
npm -v
- restore_cache:
key: v1-gradle-wrapper-{{ checksum "packages/core/examples/simple-asset-transfer/corda/gradle/wrapper/gradle-wrapper.properties" }}
- restore_cache:
key: v1-gradle-cache-{{ checksum "packages/core/examples/simple-asset-transfer/corda/build.gradle" }}
name: apt-get update
command: sudo apt-get update

- run:
name: Building Corda
command: |
cd packages/core/examples/simple-asset-transfer/
npm run corda:build
- save_cache:
paths:
- ~/.gradle/wrapper
key: v1-gradle-wrapper-{{ checksum "packages/core/examples/simple-asset-transfer/corda/gradle/wrapper/gradle-wrapper.properties" }}
- save_cache:
paths:
- ~/.gradle/caches
key: v1-gradle-cache-{{ checksum "packages/core/examples/simple-asset-transfer/corda/build.gradle" }}
name: apt-get install smem
command: sudo apt-get install -y smem

- run:
name: Starting Corda
command: |
cd packages/core/examples/simple-asset-transfer/
npm run corda
# - run:
# name: Starting Fabric
# command: |
# source /opt/circleci/.nvm/nvm.sh
# cd packages/core/examples/simple-asset-transfer/
# npm install
# cd ./fabric/api/
# npm install
# cd ../../
# npm run fabric
name: smem output
command: sudo smem --abbreviate --totals --system

# - run:
# name: Build and federation networks
# command: |
# source /opt/circleci/.nvm/nvm.sh
# cd packages/core/examples/simple-asset-transfer/
# npm run fed:build
# npm run fed:corda
# npm run fed:fabric
- run:
name: Set up nvm
command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# - run:
# name: Run scenarios
# command: |
# source /opt/circleci/.nvm/nvm.sh
# cd packages/core/examples/simple-asset-transfer/
# npm run scenario:share noquorum
# npm run scenario:CtF
# npm run scenario:FtC
# Each step uses the same `$BASH_ENV`, so need to modify it
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
- run:
name: Stopping Corda
name: Run BIF CI script
command: |
cd packages/core/examples/simple-asset-transfer/
npm run fed:corda:down
# npm run fed:fabric:down
npm run corda:down
# npm run fabric:down
./packages/core/tools/ci.sh
# Upload test results for display in Test Summary:
# https://circleci.com/docs/2.0/collect-test-data/
Expand Down
15 changes: 15 additions & 0 deletions packages/core/tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ function mainTask()
lsmem
fi

if ! [ -x "$(command -v smem)" ]; then
echo 'smem is not installed, skipping...'
else
smem --abbreviate --totals --system
fi

# Travis does not have (nor need) nvm but CircleCI does have nvm and also
# need it big time because their default Node version is 6.x...
if [ "${CIRCLECI:-false}" = "true" ]; then
set +x
nvm install 10.19.0
nvm alias default 10.19.0
set -x
fi

docker --version
docker-compose --version
node --version
Expand Down

0 comments on commit 47d22f8

Please sign in to comment.