diff --git a/.circleci/config.yml b/.circleci/config.yml index 6556ff9d18..1fde743772 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: - run: name: Run tests no_output_timeout: 30m - command: cargo build && cargo test --all + command: LEO=/home/circleci/project/project/bin/leo cargo test --all - persist_to_workspace: root: ~/ paths: project/ @@ -71,7 +71,7 @@ jobs: - run: name: Run tests no_output_timeout: 30m - command: cargo build && cargo test --all + command: LEO=/home/circleci/project/project/bin/leo cargo test --all - clear_environment: cache_key: leo-nightly-cache @@ -214,9 +214,13 @@ workflows: version: 2 main-workflow: jobs: - - rust-stable - - rust-nightly - leo-executable + - rust-stable + requires: + - leo-executable + - rust-nightly + requires: + - leo-executable - leo-new: requires: - leo-executable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e14b9d6816..c179dc7fd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,10 +114,11 @@ jobs: override: true components: rustfmt - - name: Build Leo binary - uses: actions-rs/cargo@v1 - with: - command: build + - name: Install Leo binary and set env + run: | + cargo install --path . + export LEO=$(which leo) + printenv - name: Test uses: actions-rs/cargo@v1 diff --git a/leo/tests/cmd.rs b/leo/tests/cmd.rs index 829d1aefbe..a6823aa6f9 100644 --- a/leo/tests/cmd.rs +++ b/leo/tests/cmd.rs @@ -21,7 +21,7 @@ use test_dir::{DirBuilder, FileType, TestDir}; /// Create Command from given arguments and CWD. fn command(args: &str, cwd: Option) -> Command { let args = args.split(' ').collect::>(); - let mut cmd = Command::cargo_bin("leo").unwrap(); + let mut cmd = Command::cargo_bin("leo").unwrap_or_else(|_| Command::new(std::env::var("LEO").unwrap())); if let Some(cwd) = cwd { cmd.current_dir(cwd);