name: Rust

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install rust (1.39)
      uses: actions-rs/toolchain@v1
      with:
        toolchain: 1.47.0
        override: true
    - name: Check rust  and cargo version
      run: rustc -V && cargo -V
    - name: Build
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose
    - name: Build (no default features)
      run: cargo build --verbose --no-default-features
    - name: Run tests (no default features)
      run: cargo test --verbose --no-default-features
