on:
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
name: Continuous integration
env:
RUSTFLAGS: "-D warnings"
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.58.1
features:
- '--all-features'
- '--no-default-features'
tool:
- cargo test
- wasm-pack test --node
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true
- name: Install `wasm-pack`
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
if: ${{ contains(matrix.tool, 'wasm-pack') }}
- run: ${{ matrix.tool }} --locked ${{ matrix.features }}
lint:
name: 'Format & Lints'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.58.1
components: rustfmt, clippy
override: true
- run: cargo fmt --check --all
- run: cargo clippy --all-features --all