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