diff --git a/.circleci/config.yml b/.circleci/config.yml index 426ef14306..eeb0fca330 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,8 +40,6 @@ commands: paths: - .cache/sccache - .cargo -# orbs: -# codecov: codecov/codecov@1.2.3 jobs: check-style: @@ -76,48 +74,6 @@ jobs: cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings - clear_environment: cache_key: leo-clippy-cache - - # code-cov: - # docker: - # - image: cimg/rust:1.62 - # 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 leo-executable: docker: @@ -133,7 +89,8 @@ jobs: command: cargo install --path . --root . --locked - persist_to_workspace: root: ~/ - paths: project/ + paths: + - project/ - clear_environment: cache_key: leo-executable-cache @@ -163,6 +120,19 @@ jobs: export LEO=/home/circleci/project/project/bin/leo ./project/.circleci/leo-clean.sh + test-examples: + docker: + - image: cimg/rust:1.62 + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci/project/ + - run: + name: test examples example + command: | + export LEO=/home/circleci/project/project/bin/leo + ./project/.circleci/test-examples.sh + workflows: version: 2 main-workflow: @@ -176,3 +146,6 @@ workflows: - leo-clean: requires: - leo-executable + - test-examples: + requires: + - leo-executable \ No newline at end of file diff --git a/.circleci/leo-new.sh b/.circleci/leo-new.sh index 02a0c32f1a..132dbf2381 100755 --- a/.circleci/leo-new.sh +++ b/.circleci/leo-new.sh @@ -3,5 +3,5 @@ $LEO new foo ls -la cd foo && ls -la -# Try to run `leo build`. +# Try to run `leo run`. $LEO run diff --git a/.circleci/test-examples.sh b/.circleci/test-examples.sh new file mode 100755 index 0000000000..7364e58676 --- /dev/null +++ b/.circleci/test-examples.sh @@ -0,0 +1,46 @@ +# Build and run the helloworld Leo program. +( + cd ./project/examples/helloworld || exit + $LEO run main +) + +# Build and run the bubblesort Leo program. +( + cd ./project/examples/bubblesort || exit + $LEO run bubblesort +) + +# Build and run the core example Leo program. +( + cd ./project/examples/core || exit + $LEO run main +) + +# Build and run the groups example Leo program. +( + cd ./project/examples/groups || exit + $LEO run main +) + +# Build and run the import point example Leo program. +( + cd ./project/examples/import_point || exit + $LEO run main +) + +# Build and run the message example Leo program. +( + cd ./project/examples/message || exit + $LEO run main +) + +# Build and run the token example programs. +( + cd ./project/examples/token || exit + + # Run the mint program. + $LEO run mint + + # Run the transfer program. + $LEO run transfer +) \ No newline at end of file