Skip to content

Commit

Permalink
Feat: Add Main Branch Fn Check CI (#744)
Browse files Browse the repository at this point in the history
* Feat: Add Main Branch Fn Check CI

* add key prepare in workflow

* Fix Fn_Check

Co-authored-by: Jimmy <[email protected]>
  • Loading branch information
Hcreak and jimmysun0815 authored Dec 30, 2022
1 parent a4d2794 commit 57d97f0
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Jenkinsfile
target
hooks
**/target
checkpoint.toml
46 changes: 46 additions & 0 deletions .github/workflows/Fn_Check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: FN_CHECK
on:
push:
branches:
- main
- add-fn-ckeck
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
platform: [scalable]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
- name: Prepare key
shell: bash
run: |
tar -C ~/.ssh -zcf key.tar.gz ./
- name: Build rust base image
shell: bash
run: |
make ci_build_binary_rust_base
- name: Build debug_env image and Start
shell: bash
run: |
docker build -t findorad:debug_env -f container/Dockerfile-debug-env .
docker run -d --rm --network host --name findorad-debug-env findorad:debug_env
sleep 120
- name: Run fn_check
shell: bash
run: |
docker exec findorad-debug-env /platform/tools/fn_check.sh
docker rm -f findorad-debug-env
3 changes: 2 additions & 1 deletion .github/workflows/WasmCat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Wasm Building And Pushing
on:
push:
branches:
- '**'
- main
- develop
tags:
- '*-release'

Expand Down
20 changes: 20 additions & 0 deletions container/Dockerfile-debug-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM binary-rust-base
ENV WORK_DIR /platform
ENV WASM_DIR /tmp/wasm-js-bindings
ENV VERGEN_SHA_EXTERN release_build
ENV PATH=$PATH:/root/.cargo/bin/

COPY . $WORK_DIR
WORKDIR $WORK_DIR

RUN apt-get install -y procps

RUN rustup toolchain install stable && \
rustup component add clippy --toolchain stable && \
rustup component add rustfmt

RUN mkdir -p /root/.cargo/bin/ && make debug_env

RUN printf "./tools/devnet/startnodes.sh\ntail -f /tmp/findora/devnet/node0/consensus.log" > docker_debug_env.sh
RUN chmod +x docker_debug_env.sh
CMD ["sh","-c","./docker_debug_env.sh"]
2 changes: 1 addition & 1 deletion tools/devnet/startnodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ -z "$Node" ] || ([ ! -z "$Node" ] && [ "$Node" = "$node" ]); then
TD_NODE_SELF_ADDR=$SelfAddr \
RUST_LOG=$ABCI_LOG_LEVEL \
LEDGER_DIR=$DEVNET/$node/abci \
ENABLE_LEDGER_SERVICE=true \
ENABLE_QUERY_SERVICE=true \
ENABLE_ETH_API_SERVICE=true \
abcid $DEVNET/$node >> $DEVNET/$node/abcid.log 2>&1 &
fi
Expand Down
57 changes: 57 additions & 0 deletions tools/fn_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#! /bin/bash
set -e

echo "Set Faucet Mnemonic"
echo "zoo nerve assault talk depend approve mercy surge bicycle ridge dismiss satoshi boring opera next fat cinnamon valley office actor above spray alcohol giant" > /tmp/Faucet_Mnemonic
fn setup -O /tmp/Faucet_Mnemonic -S http://localhost

echo "Init network"
stt init
sleep 15

echo "1. transfer"
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0=

echo "2. confidential-amount transfer"
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount

echo "3. confidential-type transfer"
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-type

echo "4. confidential-amount and confidential-type transfer"
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --confidential-type

echo "5. transfer-batch"
echo -e "WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0=\nevNR_3Jk8lSMSSHNdkk3d8Lq2peHicpKl0-_Wf2clfo=\nEGrwne7CoB6c3NgydG_CBmQFBL-27Shd6_cZ68ktOR8=" > /tmp/batch_list
fn transfer-batch -n 1000000 -t /tmp/batch_list

echo "6. Create Asset"
fn asset --create --memo TTT --decimal 6 --code VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= --transferable
sleep 30

echo "7. Issue Asset"
fn asset --issue --code VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ= --amount 8000000
sleep 30

echo "8. Asset transfer"
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ=
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ=
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-type --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ=
fn transfer -n 1000000 -t WJZKo8_BwLMeSz3h7jYdfjjBZlJiRdhUXkqgUVzReE0= --confidential-amount --confidential-type --asset VG9rZW4wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBUVFQ=

echo "9. Stake"
fn delegate -n 1000000 --validator 611C922247C3BE7EA13455B191B6EFD909F10196
sleep 30

echo "10. Claim rewards"
fn claim

echo "11. Unstake"
fn undelegate -n 900000 --validator 611C922247C3BE7EA13455B191B6EFD909F10196

echo "12. UTXO to EVM"
fn contract-deposit -a 0xE89441fDD60b473fBaC19F6DBcee7e7D61Bd99e6 -n 1000000
sleep 30

echo "13. EVM to UTXO"
fn contract-withdraw -n 900000 -e "abuse plug bench require oval youth spike country ten pudding power hedgehog"

0 comments on commit 57d97f0

Please sign in to comment.