| 1 | name: CI |
| 2 | on: [push, pull_request] |
| 3 | |
| 4 | jobs: |
| 5 | tests: |
| 6 | name: Tests |
| 7 | runs-on: ${{ matrix.os }} |
| 8 | strategy: |
| 9 | matrix: |
| 10 | os: [ubuntu-latest, windows-latest, macos-latest] |
| 11 | env: |
| 12 | RUST_BACKTRACE: 1 |
| 13 | steps: |
| 14 | - name: Install toolchain |
| 15 | uses: actions-rs/toolchain@v1 |
| 16 | with: |
| 17 | profile: minimal |
| 18 | toolchain: stable |
| 19 | - name: Checkout sources |
| 20 | uses: actions/checkout@v1 |
| 21 | - name: Build |
| 22 | uses: actions-rs/cargo@v1 |
| 23 | with: |
| 24 | command: build |
| 25 | args: --tests --examples |
| 26 | - name: Run tests |
| 27 | uses: actions-rs/cargo@v1 |
| 28 | with: |
| 29 | command: test |
| 30 | lints: |
| 31 | name: Lints |
| 32 | runs-on: ubuntu-latest |
| 33 | steps: |
| 34 | - name: Install toolchain |
| 35 | uses: actions-rs/toolchain@v1 |
| 36 | with: |
| 37 | profile: minimal |
| 38 | toolchain: stable |
| 39 | override: true |
| 40 | components: rustfmt, clippy |
| 41 | - uses: actions/checkout@v1 |
| 42 | - name: Run cargo fmt |
| 43 | uses: actions-rs/cargo@v1 |
| 44 | with: |
| 45 | command: fmt |
| 46 | args: --all -- --check |
| 47 | - name: Run cargo clippy |
| 48 | uses: actions-rs/cargo@v1 |
| 49 | with: |
| 50 | command: clippy |
| 51 | args: -- -D clippy::all |