xref: /tonic/.github/workflows/CI.yml (revision b02b4b23)
1name: CI
2
3on:
4  push:
5    branches:
6    - master
7  pull_request: {}
8
9jobs:
10  check:
11    runs-on: ${{ matrix.os }}
12    strategy:
13      matrix:
14        os: [ubuntu-latest]
15        rust: [stable]
16
17    env:
18      RUSTFLAGS: "-D warnings"
19
20    steps:
21    - uses: hecrj/setup-rust-action@master
22      with:
23        rust-version: ${{ matrix.rust }}
24    - uses: actions/checkout@master
25    - name: Install rustfmt
26      run: rustup component add rustfmt
27    - name: Install cargo-hack
28      run: cargo install cargo-hack
29    - name: Check fmt
30      run: cargo fmt -- --check
31    - name: Check features
32      run: cargo hack check --all --each-feature --no-dev-deps
33    - name: Check all targets
34      run: cargo check --all --all-targets --all-features
35
36  test:
37    runs-on: ${{ matrix.os }}
38    strategy:
39      matrix:
40        os: [ubuntu-latest]
41        rust: [stable]
42
43    env:
44      RUSTFLAGS: "-D warnings"
45
46    steps:
47    - uses: hecrj/setup-rust-action@master
48      with:
49        rust-version: ${{ matrix.rust }}
50    - name: Install rustfmt
51      run: rustup component add rustfmt
52    - uses: actions/checkout@master
53    - name: Run tests
54      run: cargo test --all --all-features
55
56  interop:
57    runs-on: ${{ matrix.os }}
58    strategy:
59      matrix:
60        os: [ubuntu-latest, macOS-latest]
61        rust: [stable]
62
63    env:
64      RUSTFLAGS: "-D warnings"
65
66    steps:
67    - uses: hecrj/setup-rust-action@master
68      with:
69        rust-version: ${{ matrix.rust }}
70    - uses: actions/checkout@master
71    - name: Install rustfmt
72      run: rustup component add rustfmt
73    - name: Run interop tests
74      run: ./tonic-interop/test.sh
75    - name: Run interop tests with tls
76      run: ./tonic-interop/test.sh --use_tls
77
78