mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-13 17:11:47 +08:00
145 lines
4.6 KiB
YAML
145 lines
4.6 KiB
YAML
version: 2.1
|
|
executors:
|
|
docker-publisher:
|
|
environment:
|
|
IMAGE_NAME: blockstack/stacks-blockchain
|
|
docker:
|
|
- image: circleci/buildpack-deps:stretch
|
|
jobs:
|
|
test_demo:
|
|
working_directory: /test
|
|
docker:
|
|
- image: rust:1.45-stretch
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
cargo build
|
|
- run:
|
|
command: |
|
|
./target/debug/blockstack-core local initialize db &&
|
|
./target/debug/blockstack-core local check sample-contracts/tokens.clar db &&
|
|
./target/debug/blockstack-core local launch S1G2081040G2081040G2081040G208105NK8PE5.tokens sample-contracts/tokens.clar db &&
|
|
./target/debug/blockstack-core local check sample-contracts/names.clar db &&
|
|
./target/debug/blockstack-core local launch S1G2081040G2081040G2081040G208105NK8PE5.names sample-contracts/names.clar db &&
|
|
./target/debug/blockstack-core local execute db S1G2081040G2081040G2081040G208105NK8PE5.tokens mint! SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR u100000
|
|
- run:
|
|
command: |
|
|
echo "(get-balance 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)" | ./target/debug/blockstack-core local eval S1G2081040G2081040G2081040G208105NK8PE5.tokens db
|
|
unit_tests_with_cov:
|
|
machine: true
|
|
working_directory: ~/blockstack
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Coverage via tarpaulin
|
|
command: |
|
|
docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin \
|
|
bash -c "cargo tarpaulin -v --workspace -t 300 -o Xml"
|
|
no_output_timeout: 200m
|
|
- run:
|
|
name: Upload to codecov.io
|
|
command: |
|
|
bash <(curl -s https://codecov.io/bash)
|
|
unit_tests:
|
|
docker:
|
|
- image: rust:1.40-stretch
|
|
working_directory: ~/blockstack
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
no_output_timeout: 200m
|
|
command: |
|
|
cargo test --workspace
|
|
all_tests:
|
|
docker:
|
|
- image: rust:1.40-stretch
|
|
working_directory: ~/blockstack
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
no_output_timeout: 200m
|
|
command: |
|
|
cargo test --workspace && cargo test -- --ignored --test-threads 1
|
|
build-docker:
|
|
executor: docker-publisher
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- run:
|
|
name: build docker image
|
|
no_output_timeout: 30m
|
|
command: docker build . -t $IMAGE_NAME:latest
|
|
- run:
|
|
name: save image to workspace
|
|
command: docker save -o image.tar $IMAGE_NAME:latest
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- ./image.tar
|
|
build-docker-stretch:
|
|
executor: docker-publisher
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- run:
|
|
name: build docker image
|
|
no_output_timeout: 30m
|
|
command: docker build . -f Dockerfile.stretch -t $IMAGE_NAME:stretch
|
|
- run:
|
|
name: save image to workspace
|
|
command: docker save -o image-stretch.tar $IMAGE_NAME:stretch
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- ./image-stretch.tar
|
|
push-docker-tags:
|
|
executor: docker-publisher
|
|
steps:
|
|
- attach_workspace:
|
|
at: /tmp/workspace
|
|
- setup_remote_docker
|
|
- run:
|
|
name: load docker image
|
|
command: docker load -i /tmp/workspace/image.tar
|
|
- run:
|
|
name: load docker image
|
|
command: docker load -i /tmp/workspace/image-stretch.tar
|
|
- run:
|
|
name: push docker image
|
|
command: |
|
|
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
|
|
if [ "${CIRCLE_BRANCH}" = "master" ]; then
|
|
docker tag $IMAGE_NAME:latest $IMAGE_NAME:master
|
|
docker push $IMAGE_NAME:latest
|
|
docker push $IMAGE_NAME:master
|
|
docker push $IMAGE_NAME:stretch
|
|
elif [ "${CIRCLE_BRANCH}" = "feat/docker-stretch" ]; then
|
|
docker push $IMAGE_NAME:stretch
|
|
fi
|
|
workflows:
|
|
version: 2
|
|
build-deploy:
|
|
jobs:
|
|
- unit_tests
|
|
- test_demo
|
|
- build-docker
|
|
- build-docker-stretch
|
|
- all_tests:
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- /.*net.*/
|
|
- /.*marf.*/
|
|
- push-docker-tags:
|
|
requires:
|
|
- unit_tests
|
|
- build-docker
|
|
- build-docker-stretch
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- feat/docker-stretch
|