avoid pocket-ic crate #382
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
DFX_VERSION: 0.24.2 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Cache cargo build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
- name: fmt | |
run: cargo fmt -v -- --check | |
- name: lint | |
run: cargo clippy --tests -- -D clippy::all | |
- name: Install dfx | |
uses: dfinity/setup-dfx@main | |
with: | |
dfx-version: "${{ env.DFX_VERSION }}" | |
- name: Run e2e tests against replica | |
run: | | |
echo '{}' > dfx.json | |
dfx start --background --clean | |
set -ex | |
target/debug/ic-repl examples/install.sh | |
target/debug/ic-repl examples/func.sh | |
dfx stop | |
- name: Run e2e tests against PocketIC | |
run: | | |
echo '{}' > dfx.json | |
dfx start --background --clean --pocketic | |
set -ex | |
target/debug/ic-repl examples/install.sh | |
target/debug/ic-repl examples/func.sh | |
dfx stop |