|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + |
| 8 | +env: |
| 9 | + RUST_BACKTRACE: 1 |
| 10 | + |
| 11 | +jobs: |
| 12 | + ci-pass: |
| 13 | + name: CI is green |
| 14 | + runs-on: ubuntu-latest |
| 15 | + needs: |
| 16 | + - style |
| 17 | + - test |
| 18 | + - msrv |
| 19 | + - miri |
| 20 | + - features |
| 21 | + - doc |
| 22 | + steps: |
| 23 | + - run: exit 0 |
| 24 | + |
| 25 | + style: |
| 26 | + name: Check Style |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - uses: dtolnay/rust-toolchain@stable |
| 32 | + with: |
| 33 | + components: rustfmt |
| 34 | + |
| 35 | + - run: cargo fmt --all --check |
| 36 | + |
| 37 | + test: |
| 38 | + name: Test ${{ matrix.rust }} on ${{ matrix.os }} |
| 39 | + needs: [style] |
| 40 | + strategy: |
| 41 | + matrix: |
| 42 | + rust: |
| 43 | + - stable |
| 44 | + - beta |
| 45 | + - nightly |
| 46 | + |
| 47 | + os: |
| 48 | + - ubuntu-latest |
| 49 | + - windows-latest |
| 50 | + - macOS-latest |
| 51 | + |
| 52 | + runs-on: ${{ matrix.os }} |
| 53 | + |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + |
| 57 | + - name: Install Rust (${{ matrix.rust }}) |
| 58 | + uses: dtolnay/rust-toolchain@master |
| 59 | + with: |
| 60 | + toolchain: ${{ matrix.rust }} |
| 61 | + |
| 62 | + - run: cargo test |
| 63 | + |
| 64 | + msrv: |
| 65 | + name: Check MSRV (${{ matrix.rust }}) |
| 66 | + needs: [style] |
| 67 | + strategy: |
| 68 | + matrix: |
| 69 | + rust: |
| 70 | + - 1.63 # keep in sync with MSRV.md dev doc |
| 71 | + |
| 72 | + os: |
| 73 | + - ubuntu-latest |
| 74 | + |
| 75 | + runs-on: ${{ matrix.os }} |
| 76 | + |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + |
| 80 | + - name: Install Rust (${{ matrix.rust }}) |
| 81 | + uses: dtolnay/rust-toolchain@master |
| 82 | + with: |
| 83 | + toolchain: ${{ matrix.rust }} |
| 84 | + |
| 85 | + - run: cargo check --features vendored |
| 86 | + |
| 87 | + miri: |
| 88 | + name: Test with Miri |
| 89 | + needs: [style] |
| 90 | + runs-on: ubuntu-latest |
| 91 | + |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v4 |
| 94 | + |
| 95 | + - uses: dtolnay/rust-toolchain@nightly |
| 96 | + with: |
| 97 | + components: miri |
| 98 | + |
| 99 | + - name: Test |
| 100 | + env: |
| 101 | + # Can't enable tcp feature since Miri does not support the tokio runtime |
| 102 | + MIRIFLAGS: "-Zmiri-disable-isolation" |
| 103 | + run: cargo miri test |
| 104 | + |
| 105 | + features: |
| 106 | + name: features |
| 107 | + needs: [style] |
| 108 | + runs-on: ubuntu-latest |
| 109 | + steps: |
| 110 | + - uses: actions/checkout@v4 |
| 111 | + |
| 112 | + - uses: dtolnay/rust-toolchain@stable |
| 113 | + |
| 114 | + - uses: taiki-e/install-action@cargo-hack |
| 115 | + |
| 116 | + - run: cargo hack --no-dev-deps check --feature-powerset --depth 2 |
| 117 | + |
| 118 | + doc: |
| 119 | + name: Build docs |
| 120 | + needs: [style, test] |
| 121 | + runs-on: ubuntu-latest |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v4 |
| 124 | + |
| 125 | + - uses: dtolnay/rust-toolchain@nightly |
| 126 | + |
| 127 | + - run: cargo rustdoc -- --cfg docsrs -D broken-intra-doc-links |
0 commit comments