From 59bcaa9a60b11f5678cdd75a29ce3802faf787e0 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Mon, 8 Aug 2022 11:15:11 -0700 Subject: [PATCH] leo run helloworld in circleci --- .circleci/config.yml | 13 +++++++++++++ .circleci/leo-new.sh | 2 +- .circleci/test-helloworld.sh | 5 +++++ examples/helloworld/imports/foo.leo | 8 -------- examples/helloworld/inputs/helloworld.in | 5 +---- examples/helloworld/src/main.leo | 2 -- 6 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .circleci/test-helloworld.sh delete mode 100644 examples/helloworld/imports/foo.leo diff --git a/.circleci/config.yml b/.circleci/config.yml index 426ef14306..c253e6ebc5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -163,6 +163,19 @@ jobs: export LEO=/home/circleci/project/project/bin/leo ./project/.circleci/leo-clean.sh + test-helloworld: + docker: + - image: cimg/rust:1.62 + resource_class: xlarge + steps: + - attach_workspace: + at: /home/circleci/project/ + - run: + name: test helloworld + command: | + export LEO=/home/circleci/project/project/bin/leo + ./project/.circleci/test-helloworld.sh + workflows: version: 2 main-workflow: 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-helloworld.sh b/.circleci/test-helloworld.sh new file mode 100644 index 0000000000..310ef60706 --- /dev/null +++ b/.circleci/test-helloworld.sh @@ -0,0 +1,5 @@ +# Build and run the helloworld Leo program. +cd ./project/examples/helloworld + +# Run `leo run`. +$LEO run \ No newline at end of file diff --git a/examples/helloworld/imports/foo.leo b/examples/helloworld/imports/foo.leo deleted file mode 100644 index 319eed328e..0000000000 --- a/examples/helloworld/imports/foo.leo +++ /dev/null @@ -1,8 +0,0 @@ -circuit Foo { - x: u64, - y: u64, -} - -function bar(x: u64, y: u64) -> Foo { - return Foo {x, y}; -} \ No newline at end of file diff --git a/examples/helloworld/inputs/helloworld.in b/examples/helloworld/inputs/helloworld.in index 5b350a9a64..89e24a5ea8 100644 --- a/examples/helloworld/inputs/helloworld.in +++ b/examples/helloworld/inputs/helloworld.in @@ -1,7 +1,4 @@ // The program input for helloworld/src/main.leo [main] public a: u32 = 1u32; -b: u32 = 2u32; // Input variable `b` is private by default. - -[foo] -x: u64 = 5u64; \ No newline at end of file +b: u32 = 2u32; // Input variable `b` is private by default. \ No newline at end of file diff --git a/examples/helloworld/src/main.leo b/examples/helloworld/src/main.leo index a1f61ec20c..5ea39afe25 100644 --- a/examples/helloworld/src/main.leo +++ b/examples/helloworld/src/main.leo @@ -1,5 +1,3 @@ -import foo.leo; - // The 'helloworld' main function. function main(public a: u32, b: u32) -> u32 {