aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 1c42285761142e71a3ff044825d0a72ec078a1f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI

on:
  pull_request:
  push:
    branches: 
    - master
  schedule:
  - cron: '0 22 * * *'

env:
  RUST_BACKTRACE: 1
  RUSTFLAGS: "--deny=warnings"
  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 go && go version && which cargo && cargo version && clang --version && openssl version && which cmake && cmake --version
    - run: scripts/reset-submodule.cmd
    - 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: scripts/lint-grpc-sys.sh && git diff-index --quiet HEAD

  Linux-Stable:
    name: Linux-Stable
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: which go && go version && which cargo && cargo version && clang --version && openssl version
    - run: scripts/reset-submodule.cmd
    - run: env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD
    - run: scripts/generate-bindings.sh
    - 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

  Linux-Stable-openssl:
    name: Linux-Stable-openssl
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: which go && go version && which cargo && cargo version && clang --version && openssl version
    - run: scripts/reset-submodule.cmd
    - run: cargo test --features "openssl-vendored" --all
    - run: cargo clean
    - run: cargo test --features "openssl" --all

  Linux-Nightly:
    name: Linux-Nightly
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: rustup default nightly
    - run: which go && go version && which cargo && cargo version && clang --version && openssl version
    - run: scripts/reset-submodule.cmd
    - 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 go && go version && which cargo && cargo version && clang --version && openssl version
    - run: scripts/reset-submodule.cmd
    - 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

  Mac-openssl:
    name: Mac-openssl
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2
    - run: brew update && brew upgrade openssl@1.1
    - run: which go && go version && which cargo && cargo version && clang --version && openssl version
    - run: scripts/reset-submodule.cmd
    - 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
    steps:
    - uses: actions/checkout@v2
    - run: choco install -y llvm
    - run: refreshenv
    - run: go version ; cargo version ; cmake --version 
    - run: scripts/reset-submodule.cmd
    - run: cargo build
    - run: cargo test --all
  
  Pre-Release:
    name: Pre-Release
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: scripts/reset-submodule.cmd
    - 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