| 1 | name: CI |
| 2 | on: |
| 3 | schedule: [{cron: "0 13 * * *"}] |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | pull_request: |
| 8 | |
| 9 | jobs: |
| 10 | test: |
| 11 | name: Test |
| 12 | runs-on: ${{ matrix.os }} |
| 13 | strategy: |
| 14 | matrix: |
| 15 | build: [stable, beta, nightly, macos, windows] |
| 16 | include: |
| 17 | - build: stable |
| 18 | os: ubuntu-latest |
| 19 | rust: stable |
| 20 | - build: beta |
| 21 | os: ubuntu-latest |
| 22 | rust: beta |
| 23 | - build: nightly |
| 24 | os: ubuntu-latest |
| 25 | rust: nightly |
| 26 | - build: macos |
| 27 | os: macos-latest |
| 28 | rust: stable |
| 29 | - build: windows |
| 30 | os: windows-latest |
| 31 | rust: stable |
| 32 | steps: |
| 33 | - uses: actions/checkout@v3 |
| 34 | - uses: actions-rs/toolchain@v1 |
| 35 | with: |
| 36 | toolchain: ${{ matrix.rust }} |
| 37 | components: clippy |
| 38 | override: true |
| 39 | - name: Lint |
| 40 | run: cargo clippy --all-features -- -D warnings |
| 41 | - name: Build and run tests |
| 42 | run: cargo test --all-features |
| 43 | - name: Install Tarpaulin |
| 44 | if: matrix.build == 'stable' |
| 45 | uses: actions-rs/[email protected] |
| 46 | with: |
| 47 | crate: cargo-tarpaulin |
| 48 | version: 0.22.0 |
| 49 | use-tool-cache: true |
| 50 | - name: Coverage |
| 51 | if: matrix.build == 'stable' |
| 52 | run: cargo tarpaulin --all-features -o Lcov --output-dir ./coverage |
| 53 | - name: Coveralls |
| 54 | if: matrix.build == 'stable' |
| 55 | uses: coverallsapp/github-action@master |
| 56 | with: |
| 57 | github-token: ${{ secrets.GITHUB_TOKEN }} |
| 58 | |
| 59 | rustfmt: |
| 60 | name: Rustfmt |
| 61 | runs-on: ubuntu-latest |
| 62 | steps: |
| 63 | - uses: actions/checkout@v3 |
| 64 | - uses: actions-rs/toolchain@v1 |
| 65 | with: |
| 66 | toolchain: stable |
| 67 | components: rustfmt |
| 68 | override: true |
| 69 | - run: cargo fmt -- --check |
| 70 | |
| 71 | msrv: |
| 72 | name: MSRV |
| 73 | runs-on: ubuntu-latest |
| 74 | steps: |
| 75 | - uses: actions/checkout@v3 |
| 76 | - uses: actions-rs/toolchain@v1 |
| 77 | with: |
| 78 | toolchain: "1.72" |
| 79 | override: true |
| 80 | - run: cargo build --all-features |
| 81 | |
| 82 | security_audit: |
| 83 | name: rust_audit |
| 84 | runs-on: ubuntu-latest |
| 85 | steps: |
| 86 | - uses: actions/checkout@v3 |
| 87 | - uses: actions-rs/audit-check@v1 |
| 88 | with: |
| 89 | token: ${{ secrets.GITHUB_TOKEN }} |