1name: CI 2 3on: 4 pull_request: 5 push: 6 branches: 7 - master 8 schedule: 9 - cron: '0 22 * * *' 10 11env: 12 RUST_BACKTRACE: 1 13 # Some of the bindgen tests generate "deref-nullptr" warnings, see https://github.com/rust-lang/rust-bindgen/issues/1651 14 RUSTFLAGS: "--deny=warnings --allow deref-nullptr" 15 TEST_BIND: 1 16 17jobs: 18 Linux-Format: 19 name: Linux-Format 20 runs-on: ubuntu-latest 21 steps: 22 - uses: actions/checkout@v2 23 - run: sudo apt-get install -y clang-tidy-9 24 - run: sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-9 100 25 - run: which cargo && cargo version && clang --version && openssl version && which cmake && cmake --version 26 - run: cargo xtask submodule 27 - run: cargo fmt --all -- --check 28 - run: cargo clippy --all -- -D clippy::all && cargo clippy --all --no-default-features --features prost-codec -- -D clippy::all 29 - run: cargo xtask clang-lint && git diff-index --quiet HEAD 30 31 Linux-Stable: 32 strategy: 33 matrix: 34 include: 35 - host: ubuntu-latest 36 profile: 37 suffix: 38 - host: ARM64 39 profile: --release 40 suffix: -Arm64 41 name: Linux-Stable${{ matrix.suffix }} 42 runs-on: ${{ matrix.host }} 43 steps: 44 - uses: actions/checkout@v2 45 - run: sudo apt install -y protobuf-compiler 46 - run: which cargo && cargo version && clang --version && openssl version 47 - run: cargo xtask submodule 48 - run: env TEST_BIND=0 cargo xtask bindgen && git diff --exit-code HEAD 49 - run: cargo xtask codegen && git diff --exit-code HEAD; 50 - run: cargo xtask bindgen 51 - run: cargo build --no-default-features 52 - run: cargo build --no-default-features --features protobuf-codec 53 - run: cargo build --no-default-features --features prost-codec 54 - run: cd proto && cargo build --no-default-features --features prost-codec 55 - run: cargo build 56 - run: cargo test --all ${{ matrix.profile }} 57 58 Linux-Stable-openssl: 59 strategy: 60 matrix: 61 include: 62 - host: ubuntu-latest 63 profile: 64 suffix: 65 - host: ARM64 66 profile: --release 67 suffix: -Arm64 68 name: Linux-Stable-openssl${{ matrix.suffix }} 69 runs-on: ${{ matrix.host }} 70 steps: 71 - uses: actions/checkout@v2 72 - run: which cargo && cargo version && clang --version && openssl version 73 - run: cargo xtask submodule 74 - run: cargo test --features "openssl-vendored" --all ${{ matrix.profile }} 75 - run: cargo clean 76 - run: cargo test --features "openssl" --all ${{ matrix.profile }} 77 78 Linux-Nightly: 79 name: Linux-Nightly 80 runs-on: ubuntu-latest 81 steps: 82 - uses: actions/checkout@v2 83 - run: rustup default nightly 84 - run: which cargo && cargo version && clang --version && openssl version 85 - run: cargo xtask submodule 86 - run: cargo build --no-default-features 87 - run: cargo build --no-default-features --features protobuf-codec 88 - run: cargo build --no-default-features --features prost-codec 89 - run: cargo build 90 - run: cargo test --all 91 - run: RUSTFLAGS="-Z sanitizer=address" cargo test --all --target x86_64-unknown-linux-gnu 92 93 Mac: 94 name: Mac 95 runs-on: macos-latest 96 steps: 97 - uses: actions/checkout@v2 98 - run: which cargo && cargo version && clang --version && openssl version 99 - run: cargo xtask submodule 100 - run: cargo build --no-default-features --features use-bindgen 101 - run: cargo build --no-default-features --features "protobuf-codec use-bindgen" 102 - run: cargo build --no-default-features --features "prost-codec use-bindgen" 103 - run: cargo build 104 - run: cargo test --all 105 106 Mac-openssl: 107 name: Mac-openssl 108 runs-on: macos-latest 109 steps: 110 - uses: actions/checkout@v2 111 - run: brew update && brew upgrade openssl@1.1 112 - run: which cargo && cargo version && clang --version && openssl version 113 - run: cargo xtask submodule 114 - run: OPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1/" cargo test --features "openssl" --all 115 - run: cargo test --features "openssl-vendored" --all 116 117 Win: 118 name: Windows 119 runs-on: windows-latest 120 env: 121 LIBCLANG_PATH: 'C:\Program Files\LLVM\bin' 122 RUSTFLAGS: "" 123 steps: 124 - uses: actions/checkout@v2 125 - run: choco install -y llvm 126 - run: refreshenv 127 - run: go version ; cargo version ; cmake --version 128 - run: cargo xtask submodule 129 - run: cargo build 130 - run: cargo test --all 131 132 Pre-Release: 133 name: Pre-Release 134 runs-on: ubuntu-latest 135 steps: 136 - uses: actions/checkout@v2 137 - run: cargo xtask submodule 138 - run: cd grpc-sys && cargo publish --dry-run 139 - name: Check generated package size 140 run: | 141 ls -alh target/package/grpcio-sys-*.crate 142 test `cat target/package/grpcio-sys-*.crate | wc -c` -le 10485760 143