xref: /tonic/.github/workflows/CI.yml (revision 6cdb3d46)
1name: CI
2
3env:
4  MSRV: "1.60"
5
6on:
7  push:
8    branches:
9    - master
10  pull_request: {}
11
12jobs:
13  check:
14    runs-on: ${{ matrix.os }}
15    strategy:
16      matrix:
17        os: [ubuntu-latest, macOS-latest, windows-latest]
18        rust: [stable]
19
20    env:
21      RUSTFLAGS: "-D warnings"
22
23    steps:
24    - uses: hecrj/setup-rust-action@master
25      with:
26        rust-version: ${{ matrix.rust }}
27    - uses: actions/checkout@master
28    - name: Install rustfmt
29      run: rustup component add rustfmt
30    - name: Install cargo-hack
31      run: cargo install cargo-hack
32    - name: Install Protoc
33      uses: arduino/setup-protoc@v1
34      with:
35        repo-token: ${{ secrets.GITHUB_TOKEN }}
36    - uses: Swatinem/rust-cache@v1
37    - name: Check fmt
38      run: cargo fmt -- --check
39    - name: Check features
40      run: cargo hack check --all --ignore-private --each-feature --no-dev-deps
41    - name: Check all targets
42      run: cargo check --all --all-targets --all-features
43
44  # deny-check:
45  #   name: cargo-deny check
46  #   runs-on: ubuntu-latest
47  #   steps:
48  #   - uses: actions/checkout@v1
49  #   - uses: EmbarkStudios/cargo-deny-action@v1
50
51  msrv:
52    name: Check MSRV (${{ env.MSRV }})
53    runs-on: ubuntu-latest
54    steps:
55      - name: Checkout
56        uses: actions/checkout@v1
57      - name: Install Rust (${{ env.MSRV }})
58        uses: actions-rs/toolchain@v1
59        with:
60          profile: minimal
61          toolchain: ${{ env.MSRV }}
62          override: true
63      - name: Check
64        uses: actions-rs/cargo@v1
65        with:
66          command: check
67          args: --all --all-targets --all-features
68
69  test:
70    runs-on: ${{ matrix.os }}
71    strategy:
72      matrix:
73        os: [ubuntu-latest, macOS-latest, windows-latest]
74        rust: [stable]
75
76    env:
77      RUSTFLAGS: "-D warnings"
78      # run a lot of quickcheck iterations
79      QUICKCHECK_TESTS: 1000
80
81    steps:
82    - uses: hecrj/setup-rust-action@master
83      with:
84        rust-version: ${{ matrix.rust }}
85    - name: Install rustfmt
86      run: rustup component add rustfmt
87    - name: Install Protoc
88      uses: arduino/setup-protoc@v1
89      with:
90        repo-token: ${{ secrets.GITHUB_TOKEN }}
91    - uses: Swatinem/rust-cache@v1
92    - uses: actions/checkout@master
93    - name: Run tests
94      run: cargo test --all --all-features
95
96  interop:
97    name: Interop Tests
98    runs-on: ${{ matrix.os }}
99    strategy:
100      matrix:
101        os: [ubuntu-latest, macOS-latest, windows-latest]
102        rust: [stable]
103
104    env:
105      RUSTFLAGS: "-D warnings"
106
107    steps:
108    - uses: hecrj/setup-rust-action@master
109      with:
110        rust-version: ${{ matrix.rust }}
111    - name: Install rustfmt
112      run: rustup component add rustfmt
113    - uses: actions/checkout@master
114    - name: Install Protoc
115      uses: arduino/setup-protoc@v1
116      with:
117        repo-token: ${{ secrets.GITHUB_TOKEN }}
118    - uses: Swatinem/rust-cache@v1
119    - name: Run interop tests
120      run: ./interop/test.sh
121      shell: bash
122    - name: Run interop tests with Rustls
123      run: ./interop/test.sh --use_tls tls_rustls
124      shell: bash
125