Set up IC state machine tests #224
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
paths-ignore: | |
- "README.md" | |
jobs: | |
# cargo-fmt: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - name: Cargo fmt | |
# run: | | |
# rustup component add rustfmt | |
# cargo fmt --all -- --check | |
cargo-clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install system dependencies | |
run: apt-get install protobuf-compiler | |
- run: rustup component add clippy | |
- name: Cargo clippy | |
# We run clippy twice (once without tests), so that it accurately reports dead code in the non-test configuration. | |
# `manual_range_contains` is disabled because a >= x && a < y reads more clearly than (x..y).contains(a) and | |
# there are additional caveats for floating point numbers (https://github.com/rust-lang/rust-clippy/issues/6455) | |
run: | | |
cargo clippy -- -D clippy::all -D warnings -A clippy::manual_range_contains | |
cargo clippy --tests --benches -- -D clippy::all -D warnings -A clippy::manual_range_contains | |
# cargo-deny: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - run: cargo install --locked cargo-deny | |
# - name: Cargo deny | |
# run: | | |
# cargo-deny check --hide-inclusion-graph || true | |
# cargo-audit: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - run: cargo install --locked cargo-audit | |
# - name: Cargo audit | |
# run: | | |
# cargo audit || true | |
# cargo-check: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - name: Cargo build | |
# uses: actions-rs/cargo@master | |
# with: | |
# command: check | |
# args: --all-targets | |
# cargo-build: | |
# runs-on: ubuntu-latest | |
# # needs: cargo-check | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - name: Cargo build | |
# uses: actions-rs/cargo@master | |
# with: | |
# command: build | |
# args: --tests --release | |
cargo-wasm-build: | |
runs-on: ubuntu-latest | |
# needs: cargo-check | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install system dependencies | |
run: apt-get install protobuf-compiler | |
- name: Cargo build | |
uses: actions-rs/cargo@master | |
with: | |
command: build | |
args: --tests --release --target wasm32-unknown-unknown | |
cargo-test: | |
runs-on: ubuntu-latest | |
# needs: cargo-check | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install system dependencies | |
run: apt-get install protobuf-compiler | |
- name: Cargo test | |
uses: actions-rs/cargo@master | |
with: | |
command: test | |
# candid-check: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@master | |
# - name: Check interface | |
# run: | | |
# cargo run > candid/evm_rpc_expected.did | |
# diff candid/evm_rpc.did candid/evm_rpc_expected.did | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install system dependencies | |
run: apt-get install protobuf-compiler | |
- name: Install dfx | |
run: | | |
wget --output-document install-dfx.sh "https://internetcomputer.org/install.sh" | |
bash install-dfx.sh < <(yes Y) | |
rm install-dfx.sh | |
dfx cache install | |
echo "$HOME/bin" >> $GITHUB_PATH | |
- name: Start dfx | |
run: dfx start --background | |
- name: Install npm packages | |
run: npm ci | |
- name: Deploy EVM RPC | |
run: dfx deploy evm_rpc | |
- name: Generate language bindings | |
run: npm run generate | |
- name: Test (Motoko) | |
run: dfx deploy e2e_motoko && dfx canister call e2e_motoko test | |
- name: Test (Rust) | |
run: dfx deploy e2e_rust && dfx canister call e2e_rust test | |
- name: Check formatting | |
run: cargo fmt --all -- --check |