Skip to content

Adapt to IC Backend #81

Adapt to IC Backend

Adapt to IC Backend #81

Workflow file for this run

name: Rust
on:
push:
branches: main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
name: Install Rust deps
with:
default: true
toolchain: stable
components: rustfmt
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v1
name: Setup Cache
with:
cache-on-failure: true
- uses: actions-rs/cargo@v1
name: Format
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: Check
with:
command: check
args: -q --target wasm32-unknown-unknown --all-features
- uses: actions-rs/cargo@v1
name: Documentation
with:
command: doc
args: -q --no-deps --all-features
- uses: actions-rs/cargo@v1
name: Compile tests
with:
command: test
args: -q --tests --all-features --no-run
- uses: actions-rs/cargo@v1
name: Run tests
with:
command: test
args: --tests --all-features
- name: Install Dfinity deps
run: target/bin/ic-cdk-optimizer --version || cargo install ic-cdk-optimizer -q --root target
- name: Build optimized WASM
run: ./build.sh
- name: Compile Examples
run: |
# Change the crate type from "cdylib" to "lib".
sed -i 's/"cdylib"/"lib"/g' Cargo.toml
cargo build -q --examples
git restore Cargo.toml