Skip to content

Commit

Permalink
ISMP v0.1 (#64)
Browse files Browse the repository at this point in the history
Co-authored-by: David Salami <wizdave97@gmail.com>
  • Loading branch information
seunlanlege and Wizdave97 authored Dec 31, 2023
1 parent 5e89760 commit 131c46f
Show file tree
Hide file tree
Showing 95 changed files with 112,107 additions and 42,419 deletions.
135 changes: 83 additions & 52 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: CI

on:
push:
Expand All @@ -17,66 +17,72 @@ env:
RUSTFLAGS: "-C link-args=-Wl,--allow-multiple-definition"
FOUNDRY_PROFILE: ci


jobs:
check-rust:
name: Check Workspace
check-wasm:
name: Check Wasm Crates
runs-on: ubuntu-latest
strategy:
matrix:
crate: [messier-runtime, gargantua-runtime]
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly

- uses: Swatinem/rust-cache@v1
- run: rustup target add wasm32-unknown-unknown --toolchain nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GH_TOKEN }}
- run: |
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup component add rust-src
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: check workspace
- name: check no-std
run: |
cargo +nightly check --all --benches --locked
cargo +nightly check -p ismp --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p pallet-ismp --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p ismp-demo --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p ethereum-trie --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p ismp-sync-committee --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p ${{ matrix.crate }} --no-default-features --target=wasm32-unknown-unknown --locked
check-runtime-wasm:
name: Check Runtime Wasm
check-workspace:
name: Check Workspace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
- name: Install toolchain

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v1
- run: rustup target add wasm32-unknown-unknown
toolchain: stable

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GH_TOKEN }}

- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: check runtime no-std
- uses: Swatinem/rust-cache@v1

- name: Install wasm toolchain
run: |
rustup target add wasm32-unknown-unknown
rustup component add rust-src
rustup show
- name: check workspace
run: |
cargo +nightly check -p gargantua-runtime --no-default-features --target=wasm32-unknown-unknown --locked
cargo +nightly check -p messier-runtime --no-default-features --target=wasm32-unknown-unknown --locked
cargo check --all --benches --locked
fmt:
name: Cargo fmt
Expand All @@ -92,46 +98,73 @@ jobs:
- name: Cargo fmt
run: cargo +nightly fmt --all --check

test:
name: Test Suite
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
env:
TUID: 123
steps:
- name: set UID env
run: |
echo $UID
echo "TUID=$UID" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive


- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable

- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- uses: Swatinem/rust-cache@v1

- name: Install wasm toolchain
run: |
rustup target add wasm32-unknown-unknown
rustup component add rust-src
rustup show
- name: Install protoc
run: |
sudo apt update
sudo apt install protobuf-compiler
- name: Run unit tests
run: |
cargo test --all-targets --features=runtime-benchmarks --locked
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive

- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- uses: Swatinem/rust-cache@v1

- name: Run unit tests
- name: Install wasm toolchain
run: |
cargo +nightly test -p pallet-ismp --all-targets --all-features --locked
cargo +nightly test -p ismp-testsuite --all-targets --all-features --locked
cargo +nightly test -p ethereum-trie --all-features --locked
# cd evm/forge && cargo test
rustup target add wasm32-unknown-unknown
rustup component add rust-src
rustup show
- name: Install protoc
run: |
sudo apt update
sudo apt install protobuf-compiler
- name: Clone eth-pos-devnet repository
run: |
Expand All @@ -142,16 +175,12 @@ jobs:
../scripts/wait_for_tcp_port_opening.sh localhost 3500
../scripts/wait_for_tcp_port_opening.sh localhost 8545
- name: Run all tests
- name: sync-committee integration tests
run: |
cargo +nightly test -p sync-committee-prover -- --nocapture
cargo test -p sync-committee-prover -- --nocapture --ignored
check-solidity:
strategy:
fail-fast: true

name: Foundry project
name: Check ismp-solidity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -165,11 +194,13 @@ jobs:

- name: Run Forge build
run: |
cd ./evm
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
cd ./evm
forge test -vvv
id: test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/target
/.idea
.idea/

*.log
**/node_modules/*
Expand All @@ -14,4 +14,4 @@
evm/out/
evm/cache/
evm/broadcast/
evm/forge/target/
evm/integration-tests/target/
Loading

0 comments on commit 131c46f

Please sign in to comment.