|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_TERM_COLOR: always |
| 13 | + |
| 14 | +jobs: |
| 15 | + test: |
| 16 | + name: Test & lint (${{ matrix.os }}) |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v6 |
| 24 | + |
| 25 | + - name: Install Rust |
| 26 | + uses: dtolnay/rust-toolchain@stable |
| 27 | + with: |
| 28 | + components: rustfmt, clippy |
| 29 | + |
| 30 | + - name: Cache |
| 31 | + uses: Swatinem/rust-cache@v2 |
| 32 | + with: |
| 33 | + key: ${{ matrix.os }} |
| 34 | + |
| 35 | + - name: Format |
| 36 | + if: runner.os == 'Linux' # formatting is platform-independent |
| 37 | + run: cargo fmt --all --check |
| 38 | + |
| 39 | + - name: Clippy (all features, warnings denied) |
| 40 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 41 | + |
| 42 | + - name: Test (all features) |
| 43 | + run: cargo test --all-features |
| 44 | + |
| 45 | + features: |
| 46 | + name: Feature combinations |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v6 |
| 50 | + |
| 51 | + - name: Install Rust |
| 52 | + uses: dtolnay/rust-toolchain@stable |
| 53 | + |
| 54 | + - name: Cache |
| 55 | + uses: Swatinem/rust-cache@v2 |
| 56 | + with: |
| 57 | + key: features |
| 58 | + |
| 59 | + # The sans-I/O core must build with no runtime / TLS / protocol features. |
| 60 | + - name: Core only (no default features) |
| 61 | + run: cargo build --no-default-features |
| 62 | + |
| 63 | + - name: TLS + HTTP/1.1 only |
| 64 | + run: cargo build --no-default-features --features rt-threadpool,tls |
| 65 | + |
| 66 | + - name: HTTP/2 (no HTTP/3) |
| 67 | + run: cargo build --no-default-features --features rt-threadpool,tls,h2 |
| 68 | + |
| 69 | + - name: ACME without HTTP/3 |
| 70 | + run: cargo build --no-default-features --features cli,tls,acme |
| 71 | + |
| 72 | + - name: tokio runtime |
| 73 | + run: cargo build --no-default-features --features rt-tokio,tls,h2 |
| 74 | + |
| 75 | + - name: mio runtime |
| 76 | + run: cargo build --no-default-features --features rt-mio,tls |
| 77 | + |
| 78 | + - name: Everything |
| 79 | + run: cargo build --all-features |
| 80 | + |
| 81 | + msrv: |
| 82 | + name: MSRV (Rust 1.88) |
| 83 | + runs-on: ubuntu-latest |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@v6 |
| 86 | + |
| 87 | + # Keep this pin in sync with `rust-version` in Cargo.toml. The default |
| 88 | + # feature set (no tokio/mio/rsurl) is the surface we promise to build on |
| 89 | + # the declared minimum; compile-only (behavior is covered by `test`). |
| 90 | + - name: Install Rust 1.88 (declared MSRV) |
| 91 | + uses: dtolnay/rust-toolchain@1.88 |
| 92 | + |
| 93 | + - name: Cache |
| 94 | + uses: Swatinem/rust-cache@v2 |
| 95 | + with: |
| 96 | + key: msrv |
| 97 | + |
| 98 | + - name: cargo check (default features) |
| 99 | + run: cargo check --all-targets |
| 100 | + |
| 101 | + docs: |
| 102 | + name: Docs build (warnings denied) |
| 103 | + runs-on: ubuntu-latest |
| 104 | + env: |
| 105 | + RUSTDOCFLAGS: -D warnings -D rustdoc::broken-intra-doc-links |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v6 |
| 108 | + |
| 109 | + - name: Install Rust |
| 110 | + uses: dtolnay/rust-toolchain@stable |
| 111 | + |
| 112 | + - name: Cache |
| 113 | + uses: Swatinem/rust-cache@v2 |
| 114 | + |
| 115 | + - name: cargo doc --no-deps --all-features |
| 116 | + run: cargo doc --no-deps --all-features |
0 commit comments