Skip to content

Commit

Permalink
Merge branch 'master' into forward-buf-mut-specialized-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Sep 20, 2024
2 parents eb779db + ec41014 commit 98bd2ca
Show file tree
Hide file tree
Showing 230 changed files with 8,303 additions and 4,199 deletions.
204 changes: 110 additions & 94 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,143 +2,159 @@ name: CI

on:
push:
branches:
- master
branches: [ "master" ]
pull_request: {}
merge_group:
branches: [ "master" ]

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable]
env:
RUSTFLAGS: "-D warnings"

env:
RUSTFLAGS: "-D warnings"
jobs:

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
components: rustfmt
- uses: actions/checkout@v3
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-hack
- name: Install cargo-machete
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-machete
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
- name: Check fmt
run: cargo fmt -- --check
- name: Check unused dependencies
run: cargo machete
- name: Check features
run: cargo hack check --all --ignore-private --each-feature --no-dev-deps
- name: Check all targets
run: cargo check --all --all-targets --all-features
- run: cargo fmt --all --check

check-docs:
name: check docs
deny-check:
name: cargo-deny check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2

env:
RUSTFLAGS: "-D warnings"

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: hecrj/setup-rust-action@v1
components: clippy
- uses: taiki-e/install-action@protoc
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-features --all-targets
env:
RUSTFLAGS: "-A warnings"

codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
- name: Install protoc
uses: taiki-e/install-action@v2
with:
rust-version: "1.60"
tool: protoc@3.25.1
- uses: Swatinem/rust-cache@v2
- name: cargo doc
run: cargo doc --workspace --no-deps --exclude examples
- run: cargo run --package codegen
- run: git diff --exit-code

deny-check:
name: cargo-deny check
udeps:
name: Check unused dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-08-04
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-udeps
- uses: taiki-e/install-action@protoc
- uses: Swatinem/rust-cache@v2
- run: cargo hack udeps --workspace --exclude-features tls --each-feature
- run: cargo udeps --package tonic --features tls,transport
- run: cargo udeps --package tonic --features tls,server
- run: cargo udeps --package tonic --features tls,channel

check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@protoc
- uses: Swatinem/rust-cache@v2
- name: Check features
run: cargo hack check --workspace --no-private --each-feature --no-dev-deps
- name: Check tonic feature powerset
run: cargo hack check --package tonic --feature-powerset --depth 2
- name: Check all targets
run: cargo check --workspace --all-targets --all-features

msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.60"
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: cargo check --all --all-targets --all-features
rust-version: "1.71.1" # msrv
- uses: taiki-e/install-action@cargo-no-dev-deps
- uses: Swatinem/rust-cache@v2
- run: cargo no-dev-deps --no-private check --all-features
- run: cargo no-dev-deps --no-private doc --no-deps
env:
RUSTDOCFLAGS: "-D warnings"

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable]

env:
RUSTFLAGS: "-D warnings"
# run a lot of quickcheck iterations
QUICKCHECK_TESTS: 1000

steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
- uses: taiki-e/install-action@protoc
- uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --all --all-features
- run: cargo test --workspace --all-features
env:
QUICKCHECK_TESTS: 1000 # run a lot of quickcheck iterations

interop:
name: Interop Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable]

env:
RUSTFLAGS: "-D warnings"

steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: rustfmt
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
- uses: taiki-e/install-action@protoc
- uses: Swatinem/rust-cache@v2
- name: Run interop tests
run: ./interop/test.sh
shell: bash
- name: Run interop tests with Rustls
run: ./interop/test.sh --use_tls tls_rustls
shell: bash

semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: all-features

check-external-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-05-01
- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-check-external-types@0.1.12
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- run: cargo hack --no-private check-external-types
Loading

0 comments on commit 98bd2ca

Please sign in to comment.