name: CI
"on": [push, pull_request]
defaults:
run:
shell: bash
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
cargo_flags:
- ""
- "--no-default-features"
- '--no-default-features --features "alloc"'
- '--no-default-features --features "alloc std"'
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all ${{ matrix.cargo_flags }} -- -D warnings
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- 1.60.0
- stable
- beta
- nightly
cargo_flags:
- ""
- "--no-default-features"
- '--no-default-features --features "alloc"'
- '--no-default-features --features "alloc std"'
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Build
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
with:
command: build
args: --verbose --all ${{ matrix.cargo_flags }}
- name: Test
uses: actions-rs/cargo@v1
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
with:
command: test
args: --verbose --all ${{ matrix.cargo_flags }}
test_no_alloc:
name: Test no-alloc
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/no-alloc
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: build
args: --verbose --all
test_no_std:
name: Test no-std
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/no-std
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Build
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: build
args: --verbose --all
test_re_export:
name: Test re-export
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/re-export
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Test
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: --verbose --all
test_use_re_exported:
name: Test use-re-exported
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tests/use-re-exported
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Test
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: --verbose --all
test_wasm_bindgen_example:
name: Test wasm_bindgen example
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./examples/wasm_bindgen
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Wasm Pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Test
run: wasm-pack test --node | grep -q succeed