Skip to content

chore: set up mainnet E2E testing environment #293

chore: set up mainnet E2E testing environment

chore: set up mainnet E2E testing environment #293

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
tags:
- v*
paths-ignore:
- "README.md"
jobs:
cargo-clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v2
- 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-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Cargo test
run: unset CI && cargo test
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: Swatinem/rust-cache@v2
- 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