Skip to content

Test examples from the README #38

Test examples from the README

Test examples from the README #38

Workflow file for this run

name: Check and Test
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [ 1.58.1, 1.61.0 ]
steps:
- uses: actions/checkout@v2
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
source $HOME/.cargo/env
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
rustup component add rustfmt
- name: Check
# We can't use --all-targets because it includes benches which requires nightly compiler
run: $HOME/.cargo/bin/cargo check --workspace --lib --bins --examples --tests
- name: Clippy
# We can't use --all-targets because it includes benches which requires nightly compiler
run: $HOME/.cargo/bin/cargo clippy --workspace --lib --bins --examples --tests
- name: Check Format
run: $HOME/.cargo/bin/cargo fmt --check
- name: Test
run: $HOME/.cargo/bin/cargo test --workspace
env:
RUST_BACKTRACE: 1