Skip to content

ci: 🔨 fix v0.10.2 build #12

ci: 🔨 fix v0.10.2 build

ci: 🔨 fix v0.10.2 build #12

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request: {}
env:
PROTOC_VERSION: 3.23.4
RUSTFLAGS: "-D warnings"
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cargo fmt --all --check
deny-check:
# NOTE(kate): this allows for duplicate dependencies of a single crate.
# Since 0.10.2 was released, releases have drifted and `prost-build` and
# `strum-macros` depend on different versions of `heck`.
#
# rather than changing v0.10.2, we pass `--allow duplicate` for now, until
# we upgrade to [email protected].
#
# ```
# error[duplicate]: found 2 duplicate entries for crate 'heck'
# ┌─ /home/katie/work/tonic/Cargo.lock:58:1
# │
# 58 │ ╭ heck 0.4.1 registry+https://github.com/rust-lang/crates.io-index
# 59 │ │ heck 0.5.0 registry+https://github.com/rust-lang/crates.io-index
# │ ╰────────────────────────────────────────────────────────────────^ lock entries
# ```
name: cargo-deny check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
command-arguments: "--allow duplicate"
codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- run: cargo run --package codegen
- run: git diff --exit-code
udeps:
name: Check unused dependencies
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: windows-latest
option: --exclude-features uds
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-udeps
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- run: cargo hack udeps --workspace --each-feature ${{ matrix.option }}
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
- uses: taiki-e/install-action@cargo-hack
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: Check features
run: cargo hack check --workspace --ignore-private --each-feature --no-dev-deps
- name: Check all targets
run: cargo check --workspace --all-targets --all-features
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.70" # msrv
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-targets --all-features
- run: cargo doc --no-deps --package tonic --package tonic-build --package tonic-health --package tonic-reflection --package tonic-types --package tonic-web
env:
RUSTDOCFLAGS: "-D warnings"
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- 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]
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- 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