1on: [push, pull_request] 2 3name: MSRV 4 5jobs: 6 check: 7 name: Check 8 runs-on: ubuntu-latest 9 strategy: 10 matrix: 11 rust: 12 - 1.56.1 13 - stable 14 - beta 15 - nightly 16 17 steps: 18 - name: Checkout sources 19 uses: actions/checkout@v3 20 21 - name: Install toolchain 22 uses: actions-rs/toolchain@v1 23 with: 24 toolchain: ${{ matrix.rust }} 25 minimal: true 26 override: true 27 28 - name: Install Cargo.lock.msrv 29 run: cp Cargo.lock.msrv Cargo.lock 30 31 - name: Run cargo check 32 if: matrix.rust != 'nightly' 33 uses: actions-rs/cargo@v1 34 with: 35 command: check 36 37 - name: Run cargo check (nightly) 38 if: matrix.rust == 'nightly' 39 continue-on-error: true 40 uses: actions-rs/cargo@v1 41 with: 42 command: check 43 44 test: 45 needs: [check] 46 name: Test Suite 47 runs-on: ubuntu-latest 48 strategy: 49 matrix: 50 rust: 51 - 1.56.1 52 - stable 53 - beta 54 - nightly 55 steps: 56 - name: Checkout sources 57 uses: actions/checkout@v3 58 59 - name: Install toolchain 60 uses: actions-rs/toolchain@v1 61 with: 62 toolchain: ${{ matrix.rust }} 63 minimal: true 64 override: true 65 66 - name: Install Cargo.lock.msrv 67 run: cp Cargo.lock.msrv Cargo.lock 68 69 - name: Run cargo test 70 if: matrix.rust != 'nightly' && matrix.rust != '1.56.1' 71 uses: actions-rs/cargo@v1 72 with: 73 command: test 74 args: --all-features 75 76 - name: Run cargo test (nightly) 77 if: matrix.rust == '1.56.1' 78 continue-on-error: true 79 uses: actions-rs/cargo@v1 80 with: 81 command: test 82 args: --tests --all-features 83 84 - name: Run cargo test (nightly) 85 if: matrix.rust == 'nightly' 86 continue-on-error: true 87 uses: actions-rs/cargo@v1 88 with: 89 command: test 90 args: --all-features 91 92 fmt: 93 needs: [check] 94 name: Rustfmt 95 runs-on: ubuntu-latest 96 strategy: 97 matrix: 98 rust: 99 - stable 100 - beta 101 steps: 102 - name: Checkout sources 103 uses: actions/checkout@v3 104 105 - name: Install toolchain 106 uses: actions-rs/toolchain@v1 107 with: 108 toolchain: ${{ matrix.rust }} 109 minimal: true 110 override: true 111 components: rustfmt 112 113 - name: Run cargo fmt 114 uses: actions-rs/cargo@v1 115 with: 116 command: fmt 117 args: --all -- --check 118 119 clippy: 120 needs: [check] 121 name: Clippy 122 runs-on: ubuntu-latest 123 steps: 124 - name: Checkout sources 125 uses: actions/checkout@v3 126 127 - name: Install toolchain 128 uses: actions-rs/toolchain@v1 129 with: 130 toolchain: 1.56.1 131 override: true 132 components: clippy 133 134 - name: Install Cargo.lock.msrv 135 run: cp Cargo.lock.msrv Cargo.lock 136 137 - name: Run cargo clippy 138 uses: actions-rs/cargo@v1 139 with: 140 command: clippy 141 args: --all-targets --all-features -- -D warnings 142 143 check-examples: 144 name: Check examples 145 needs: [check] 146 runs-on: ubuntu-latest 147 strategy: 148 matrix: 149 rust: 150 - 1.56.1 151 - stable 152 153 steps: 154 - name: Checkout sources 155 uses: actions/checkout@v3 156 157 - name: Install toolchain 158 uses: actions-rs/toolchain@v1 159 with: 160 toolchain: ${{ matrix.rust }} 161 minimal: true 162 override: true 163 164 - name: Install Cargo.lock.msrv 165 run: cp Cargo.lock.msrv Cargo.lock 166 167 - name: Run cargo check 168 uses: actions-rs/cargo@v1 169 with: 170 command: check 171 args: --examples 172 173