name: Build

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
      - name: Build
        run: |
          cargo check
          cargo fmt -- --check
          cargo clippy -- -D warnings
          cargo test --features native-tls
          cargo test --features native-tls,live,live-native-tls
