Adapt to IC Backend #82
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: 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-wasm --version || cargo install ic-wasm -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 |