Merge pull request #553 from AleoHQ/feat/ci-cli

Expand ci on leo commands
This commit is contained in:
Collin Chin 2021-01-19 11:14:38 -05:00 committed by GitHub
commit 9e31227522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 142 additions and 34 deletions

View File

@ -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:

76
.github/workflows/leo-clean.yml vendored Normal file
View File

@ -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

48
.github/workflows/leo-init.yml vendored Normal file
View File

@ -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

View File

@ -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

View File

@ -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";