Add leo clean to circleci

This commit is contained in:
howardwu 2021-02-24 21:45:06 -08:00
parent 345d09d186
commit 808e631014
4 changed files with 50 additions and 98 deletions

View File

@ -81,11 +81,24 @@ jobs:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo new
name: leo init
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-init.sh
leo-clean:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo clean
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clean.sh
workflows:
version: 2
main-workflow:
@ -97,3 +110,6 @@ workflows:
- leo-init:
requires:
- rust-stable
- leo-clean:
requires:
- rust-stable

33
.circleci/leo-clean.sh Executable file
View File

@ -0,0 +1,33 @@
# leo new hello-world
$LEO new hello-world
ls -la
cd hello-world && ls -la
$LEO run
# Assert that the 'outputs' folder is not empty
cd outputs || exit 1
if [ "$(ls -A $DIR)" ]; then
echo "$DIR is not empty"
else
echo "$DIR is empty"
exit 1
fi
cd ..
# leo clean
$LEO clean
cd outputs && ls -la
# Assert that the 'outputs' folder is empty
cd outputs || exit 1
if [ "$(ls -A $DIR)" ]; then
echo "$DIR is not empty"
exit 1
else
echo "$DIR is empty"
exit 0
fi

View File

@ -1,48 +0,0 @@
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,49 +0,0 @@
name: leo-new
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