2021-02-25 07:03:50 +03:00
version : 2.1
commands :
setup_environment :
2021-02-25 07:20:02 +03:00
description : "Setup environment"
2021-02-25 07:03:50 +03:00
parameters :
cache_key :
type : string
2021-07-14 23:59:51 +03:00
default : leo-stable-linux-cache
2021-02-25 07:03:50 +03:00
steps :
- run : set -e
- setup_remote_docker
- run :
name : Prepare environment and install dependencies
command : |
export SCCACHE_CACHE_SIZE=200M
export WORK_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
export SCCACHE_DIR="$CIRCLE_WORKING_DIRECTORY/.cache/sccache"
mkdir -p "$CIRCLE_WORKING_DIRECTORY/.bin"
wget https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
tar -C "$CIRCLE_WORKING_DIRECTORY/.bin" -xvf sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
mv $CIRCLE_WORKING_DIRECTORY/.bin/sccache-0.2.13-x86_64-unknown-linux-musl/sccache $CIRCLE_WORKING_DIRECTORY/.bin/sccache
export PATH="$PATH:$CIRCLE_WORKING_DIRECTORY/.bin"
export RUSTC_WRAPPER="sccache"
rm -rf "$CIRCLE_WORKING_DIRECTORY/.cargo/registry"
sudo apt-get update && sudo apt-get install -y clang llvm-dev llvm pkg-config xz-utils make libssl-dev libssl-dev
- restore_cache :
keys :
- << parameters.cache_key >>
clear_environment :
description : "Clear environment"
parameters :
cache_key :
type : string
2021-07-14 23:59:51 +03:00
default : leo-stable-linux-cache
2021-02-25 07:03:50 +03:00
steps :
- run : (sccache -s||true)
- run : set +e
- save_cache :
key : << parameters.cache_key >>
paths :
- .cache/sccache
- .cargo
2021-07-16 12:19:11 +03:00
# orbs:
# codecov: codecov/codecov@1.2.3
2021-07-14 23:59:51 +03:00
2021-02-25 07:03:50 +03:00
jobs :
2021-07-16 12:19:11 +03:00
check-style :
2021-07-14 23:59:51 +03:00
docker :
2021-07-19 05:58:34 +03:00
- image : cimg/rust:1.53
2021-07-14 23:59:51 +03:00
resource_class : xlarge
steps :
- checkout
- setup_environment :
cache_key : leo-fmt-cache
- run :
name : Check style
no_output_timeout : 35m
command : cargo fmt --all -- --check
- clear_environment :
cache_key : leo-fmt-cache
2021-02-25 07:11:23 +03:00
2021-07-14 23:59:51 +03:00
clippy :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-07-14 23:59:51 +03:00
resource_class : xlarge
steps :
- checkout
- setup_environment :
cache_key : leo-clippy-cache
- run :
name : Clippy
no_output_timeout : 35m
command : cargo clippy --all-features --examples --all --benches
- clear_environment :
cache_key : leo-clippy-cache
2021-07-16 12:19:11 +03:00
# code-cov:
# docker:
# - image: cimg/rust:1.53.0
# resource_class: xlarge
# environment:
# RUSTC_BOOTSTRAP: 1
# steps:
# - checkout
# - setup_environment:
# cache_key: leo-codecov-cache
# - run:
# name: Build and run tests
# no_output_timeout: 30m
# command: cargo test --all
# - run:
# name: Install Code Cov Deps
# no_output_timeout: 30m
# command: |
# sudo apt-get update
# sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
# - run:
# name: Generate Coverage Report
# no_output_timeout: 30m
# command: |
# wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
# tar xzf master.tar.gz
# cd kcov-master
# mkdir build && cd build
# cmake .. && make
# make install DESTDIR=../../kcov-build
# cd ../..
# rm -rf kcov-master
# for file in target/debug/deps/*-*; do if [[ "$file" != *\.* ]]; then mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --exclude-region='@kcov_skip(start):@kcov_skip(end)' --verify "target/cov/$(basename $file)" "$file"; fi done
# steps:
# - codecov/upload:
# file: {{}}
# - persist_to_workspace:
# root: ~/
# paths: project/
# - clear_environment:
# cache_key: leo-codecov-cache
2021-03-16 06:34:37 +03:00
2021-03-16 06:44:37 +03:00
leo-executable :
2021-02-25 07:03:50 +03:00
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-04-01 09:20:10 +03:00
resource_class : xlarge
2021-02-25 07:03:50 +03:00
steps :
- checkout
- setup_environment :
2021-03-16 06:44:37 +03:00
cache_key : leo-executable-cache
2021-02-25 07:03:50 +03:00
- run :
2021-03-16 06:41:04 +03:00
name : Build and install Leo
2021-02-25 07:03:50 +03:00
no_output_timeout : 30m
2021-04-01 09:20:10 +03:00
command : cargo install --path . --root . --locked
2021-02-25 07:03:50 +03:00
- persist_to_workspace :
2021-02-25 07:55:29 +03:00
root : ~/
2021-02-25 07:03:50 +03:00
paths : project/
- clear_environment :
2021-03-16 06:44:37 +03:00
cache_key : leo-executable-cache
2021-02-25 07:11:23 +03:00
2021-02-25 07:03:50 +03:00
leo-new :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 07:03:50 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo new
2021-02-25 08:11:31 +03:00
command : |
2021-02-25 08:32:57 +03:00
export LEO=/home/circleci/project/project/bin/leo
2021-02-25 08:23:47 +03:00
./project/.circleci/leo-new.sh
leo-init :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 08:23:47 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
2021-02-25 08:45:06 +03:00
name : leo init
2021-02-25 08:23:47 +03:00
command : |
2021-02-25 08:32:57 +03:00
export LEO=/home/circleci/project/project/bin/leo
2021-02-25 08:23:47 +03:00
./project/.circleci/leo-init.sh
2021-02-25 07:03:50 +03:00
2021-02-25 08:45:06 +03:00
leo-clean :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 08:45:06 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo clean
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clean.sh
2021-02-25 09:22:29 +03:00
leo-setup :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 09:22:29 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo setup
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-setup.sh
2021-02-25 08:59:06 +03:00
leo-add-remove :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 08:59:06 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo add & remove
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-add-remove.sh
2021-03-29 10:57:37 +03:00
leo-check-constraints :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-03-29 10:57:37 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo check constraints for Pedersen Hash
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-check-constraints.sh
2021-02-25 09:22:29 +03:00
leo-login-logout :
2021-02-25 09:13:55 +03:00
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 09:13:55 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
2021-02-25 09:22:29 +03:00
name : leo login & logout
2021-02-25 09:13:55 +03:00
command : |
export LEO=/home/circleci/project/project/bin/leo
2021-02-25 09:22:29 +03:00
./project/.circleci/leo-login-logout.sh
2021-02-25 09:13:55 +03:00
2021-04-22 00:09:15 +03:00
leo-clone :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-04-22 00:09:15 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo clone
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clone.sh
2021-02-25 20:34:06 +03:00
leo-publish :
docker :
2021-07-17 10:47:31 +03:00
- image : cimg/rust:1.53
2021-02-25 20:34:06 +03:00
resource_class : xlarge
steps :
- attach_workspace :
at : /home/circleci/project/
- run :
name : leo publish
command : |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-publish.sh
2021-02-25 07:03:50 +03:00
workflows :
version : 2
main-workflow :
jobs :
2021-07-16 12:19:11 +03:00
- check-style
2021-07-14 23:59:51 +03:00
- clippy
2021-03-16 06:44:37 +03:00
- leo-executable
2021-03-16 06:34:37 +03:00
- leo-new :
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-02-25 08:23:47 +03:00
- leo-init :
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-02-25 08:45:06 +03:00
- leo-clean :
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-02-25 09:22:29 +03:00
- leo-setup :
2021-02-25 08:59:06 +03:00
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-02-25 09:22:29 +03:00
- leo-add-remove :
2021-02-25 09:13:55 +03:00
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-03-29 11:00:31 +03:00
- leo-check-constraints :
requires :
- leo-executable
2021-02-25 09:22:29 +03:00
- leo-login-logout :
requires :
2021-03-16 06:44:37 +03:00
- leo-executable
2021-04-22 00:09:15 +03:00
- leo-clone :
requires :
- leo-executable
2021-02-25 20:34:06 +03:00
- leo-publish :
requires :
2021-03-16 06:44:37 +03:00
- leo-executable