name: Rust
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
toolchain: ["stable", "nightly"]
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install ${{matrix.toolchain}} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.toolchain}}
override: true
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
wasm:
name: WebAssembly
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
toolchain: ["stable"]
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: "12"
- name: Install ${{matrix.toolchain}} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: ${{matrix.toolchain}}
override: true
- name: Use wasmtime 0.23.0
uses: mwilliamson/setup-wasmtime-action@v1
with:
wasmtime-version: "0.23.0"
- name: Check if it tests under wasmtime
run: |-
cargo test --target wasm32-wasi --all-features
lints:
name: Lints
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["stable"]
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install ${{matrix.toolchain}} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.toolchain}}
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings