From 5e4cb93e31065b979099f75bc8f38f250a838ff0 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+kristof-mattei@users.noreply.github.com> Date: Fri, 3 Nov 2023 05:22:32 -0700 Subject: [PATCH] chore: port CI from hyper-util (#103) --- .github/workflows/CI.yml | 127 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 10 --- 2 files changed, 127 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..ffd3c75 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,127 @@ +name: CI +on: + pull_request: + push: + branches: + - master + +env: + RUST_BACKTRACE: 1 + +jobs: + ci-pass: + name: CI is green + runs-on: ubuntu-latest + needs: + - style + - test + - msrv + - miri + - features + - doc + steps: + - run: exit 0 + + style: + name: Check Style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - run: cargo fmt --all --check + + test: + name: Test ${{ matrix.rust }} on ${{ matrix.os }} + needs: [style] + strategy: + matrix: + rust: + - stable + - beta + - nightly + + os: + - ubuntu-latest + - windows-latest + - macOS-latest + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust (${{ matrix.rust }}) + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + + - run: cargo test + + msrv: + name: Check MSRV (${{ matrix.rust }}) + needs: [style] + strategy: + matrix: + rust: + - 1.63 # keep in sync with MSRV.md dev doc + + os: + - ubuntu-latest + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust (${{ matrix.rust }}) + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + + - run: cargo check --features vendored + + miri: + name: Test with Miri + needs: [style] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@nightly + with: + components: miri + + - name: Test + env: + # Can't enable tcp feature since Miri does not support the tokio runtime + MIRIFLAGS: "-Zmiri-disable-isolation" + run: cargo miri test + + features: + name: features + needs: [style] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - uses: taiki-e/install-action@cargo-hack + + - run: cargo hack --no-dev-deps check --feature-powerset --depth 2 + + doc: + name: Build docs + needs: [style, test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@nightly + + - run: cargo rustdoc -- --cfg docsrs -D broken-intra-doc-links diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 81d3af0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: rust -rust: -# - stable -# - beta - - nightly - -sudo: false - -notifications: - email: false