143 lines
4.7 KiB
YAML
143 lines
4.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: '0 22 * * *'
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
# Some of the bindgen tests generate "deref-nullptr" warnings, see https://github.com/rust-lang/rust-bindgen/issues/1651
|
|
RUSTFLAGS: "--deny=warnings --allow deref-nullptr"
|
|
TEST_BIND: 1
|
|
|
|
jobs:
|
|
Linux-Format:
|
|
name: Linux-Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: sudo apt-get install -y clang-tidy-9
|
|
- run: sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-9 100
|
|
- run: which cargo && cargo version && clang --version && openssl version && which cmake && cmake --version
|
|
- run: cargo xtask submodule
|
|
- run: cargo fmt --all -- --check
|
|
- run: cargo clippy --all -- -D clippy::all && cargo clippy --all --no-default-features --features prost-codec -- -D clippy::all
|
|
- run: cargo xtask clang-lint && git diff-index --quiet HEAD
|
|
|
|
Linux-Stable:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- host: ubuntu-latest
|
|
profile:
|
|
suffix:
|
|
- host: ARM64
|
|
profile: --release
|
|
suffix: -Arm64
|
|
name: Linux-Stable${{ matrix.suffix }}
|
|
runs-on: ${{ matrix.host }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: sudo apt install -y protobuf-compiler
|
|
- run: which cargo && cargo version && clang --version && openssl version
|
|
- run: cargo xtask submodule
|
|
- run: env TEST_BIND=0 cargo xtask bindgen && git diff --exit-code HEAD
|
|
- run: cargo xtask codegen && git diff --exit-code HEAD;
|
|
- run: cargo xtask bindgen
|
|
- run: cargo build --no-default-features
|
|
- run: cargo build --no-default-features --features protobuf-codec
|
|
- run: cargo build --no-default-features --features prost-codec
|
|
- run: cd proto && cargo build --no-default-features --features prost-codec
|
|
- run: cargo build
|
|
- run: cargo test --all ${{ matrix.profile }}
|
|
|
|
Linux-Stable-openssl:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- host: ubuntu-latest
|
|
profile:
|
|
suffix:
|
|
- host: ARM64
|
|
profile: --release
|
|
suffix: -Arm64
|
|
name: Linux-Stable-openssl${{ matrix.suffix }}
|
|
runs-on: ${{ matrix.host }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: which cargo && cargo version && clang --version && openssl version
|
|
- run: cargo xtask submodule
|
|
- run: cargo test --features "openssl-vendored" --all ${{ matrix.profile }}
|
|
- run: cargo clean
|
|
- run: cargo test --features "openssl" --all ${{ matrix.profile }}
|
|
|
|
Linux-Nightly:
|
|
name: Linux-Nightly
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: rustup default nightly
|
|
- run: which cargo && cargo version && clang --version && openssl version
|
|
- run: cargo xtask submodule
|
|
- run: cargo build --no-default-features
|
|
- run: cargo build --no-default-features --features protobuf-codec
|
|
- run: cargo build --no-default-features --features prost-codec
|
|
- run: cargo build
|
|
- run: cargo test --all
|
|
- run: RUSTFLAGS="-Z sanitizer=address" cargo test --all --target x86_64-unknown-linux-gnu
|
|
|
|
Mac:
|
|
name: Mac
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: which cargo && cargo version && clang --version && openssl version
|
|
- run: cargo xtask submodule
|
|
- run: cargo build --no-default-features --features use-bindgen
|
|
- run: cargo build --no-default-features --features "protobuf-codec use-bindgen"
|
|
- run: cargo build --no-default-features --features "prost-codec use-bindgen"
|
|
- run: cargo build
|
|
- run: cargo test --all
|
|
|
|
Mac-openssl:
|
|
name: Mac-openssl
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: brew update && brew upgrade openssl@1.1
|
|
- run: which cargo && cargo version && clang --version && openssl version
|
|
- run: cargo xtask submodule
|
|
- run: OPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1/" cargo test --features "openssl" --all
|
|
- run: cargo test --features "openssl-vendored" --all
|
|
|
|
Win:
|
|
name: Windows
|
|
runs-on: windows-latest
|
|
env:
|
|
LIBCLANG_PATH: 'C:\Program Files\LLVM\bin'
|
|
RUSTFLAGS: ""
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: choco install -y llvm
|
|
- run: refreshenv
|
|
- run: go version ; cargo version ; cmake --version
|
|
- run: cargo xtask submodule
|
|
- run: cargo build
|
|
- run: cargo test --all
|
|
|
|
Pre-Release:
|
|
name: Pre-Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: cargo xtask submodule
|
|
- run: cd grpc-sys && cargo publish --dry-run
|
|
- name: Check generated package size
|
|
run: |
|
|
ls -alh target/package/grpcio-sys-*.crate
|
|
test `cat target/package/grpcio-sys-*.crate | wc -c` -le 10485760
|