name: Continuous Integration
on:
  push:
  pull_request:
  schedule:
    - cron: "0 0 1,15 * *"

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust: [stable, beta, nightly]

    steps:
      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: ${{ matrix.rust }}
      - uses: actions/checkout@v1
      - name: Run tests
        run: cargo test --all-features

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: stable
          components: clippy
      - uses: actions/checkout@v1
      - name: Clippy
        run: cargo clippy -- -D warnings
