diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0470b29026..8afe275808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,14 @@ jobs: toolchain: ${{ matrix.rust }} override: true + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + # - name: Check examples # uses: actions-rs/cargo@v1 # env: diff --git a/.github/workflows/leo-clean.yml b/.github/workflows/leo-clean.yml new file mode 100644 index 0000000000..177ed73fdc --- /dev/null +++ b/.github/workflows/leo-clean.yml @@ -0,0 +1,76 @@ +name: leo-clean +on: + pull_request: + push: + branches: + - master + paths-ignore: + - 'docs/**' + - 'documentation/**' +env: + RUST_BACKTRACE: 1 + +jobs: + new: + name: Hello Leo ('leo new hello-world') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install Leo + uses: actions-rs/cargo@v1 + with: + command: install + args: --path . + + - name: 'leo new hello-world' + run: | + cd .. + leo new hello-world + ls -la + cd hello-world && ls -la + leo run + + - name: Assert that the 'outputs' folder is not empty + run: | + cd ../hello-world/outputs + if [ "$(ls -A $DIR)" ]; then + echo "$DIR is not empty" + else + echo "$DIR is empty" + exit 1 + fi + + - name: 'leo clean' + run: | + cd ../hello-world + leo clean + cd outputs && ls -la + + - name: Assert that the 'outputs' folder is empty + run: | + cd ../hello-world/outputs + if [ "$(ls -A $DIR)" ]; then + echo "$DIR is not empty" + exit 1 + else + echo "$DIR is empty" + exit 0 + fi diff --git a/.github/workflows/leo-init.yml b/.github/workflows/leo-init.yml new file mode 100644 index 0000000000..1821d1de86 --- /dev/null +++ b/.github/workflows/leo-init.yml @@ -0,0 +1,48 @@ +name: leo-init +on: + pull_request: + push: + branches: + - master + paths-ignore: + - 'docs/**' + - 'documentation/**' +env: + RUST_BACKTRACE: 1 + +jobs: + init: + name: Hello Leo ('leo init') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install Leo + uses: actions-rs/cargo@v1 + with: + command: install + args: --path . + + - name: 'leo init' + run: | + cd .. && mkdir hello-world && cd hello-world + leo init + ls -la + leo run diff --git a/.github/workflows/ci-binary.yml b/.github/workflows/leo-new.yml similarity index 52% rename from .github/workflows/ci-binary.yml rename to .github/workflows/leo-new.yml index 3ad7d8cf33..842d553897 100644 --- a/.github/workflows/ci-binary.yml +++ b/.github/workflows/leo-new.yml @@ -1,4 +1,4 @@ -name: Leo Binary Tests +name: leo-new on: pull_request: push: @@ -26,10 +26,16 @@ jobs: override: true components: rustfmt + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install Leo uses: actions-rs/cargo@v1 - env: - CARGO_NET_GIT_FETCH_WITH_CLI: true with: command: install args: --path . @@ -41,33 +47,3 @@ jobs: ls -la cd hello-world && ls -la leo run - - init: - name: Hello Leo ('leo init') - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt - - - name: Install Leo - uses: actions-rs/cargo@v1 - env: - CARGO_NET_GIT_FETCH_WITH_CLI: true - with: - command: install - args: --path . - - - name: 'leo init' - run: | - cd .. && mkdir hello-world && cd hello-world - leo init - ls -la - leo run diff --git a/leo/commands/watch.rs b/leo/commands/watch.rs index b761f8aa47..6475be7782 100644 --- a/leo/commands/watch.rs +++ b/leo/commands/watch.rs @@ -30,7 +30,7 @@ impl CLI for WatchCommand { type Options = (); type Output = (); - const ABOUT: AboutType = "Watch the changes of the leo's source files"; + const ABOUT: AboutType = "Watch for changes of Leo source files"; const ARGUMENTS: &'static [ArgumentType] = &[]; const FLAGS: &'static [FlagType] = &[]; const NAME: NameType = "watch";