-
Notifications
You must be signed in to change notification settings - Fork 252
98 lines (82 loc) · 2.62 KB
/
ci.yml
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
on:
pull_request:
branches:
- main
- mqtt5-client
paths:
- '**.rs'
- 'Cargo.*'
- '*/Cargo.*'
- '.github/workflows/*'
push:
branches:
- main
name: CI
env:
RUSTFLAGS: "-D warnings"
CARGO_INCREMENTAL: 0
defaults:
run:
shell: bash
jobs:
test:
name: Build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v4
# use mold linker instead of the default linker only on linux
- uses: rui314/setup-mold@v1
if: ${{ runner.os == 'Linux' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-cargo
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack,cargo-llvm-cov,nextest
# - name: Check benchmarks
# uses: actions-rs/cargo@v1
# env:
# RUSTFLAGS: "-D warnings"
# # NOTE: benchmarks are limited to compiling only on non windows systems, without any features enabled.
# if: ${{ matrix.os != 'windows-latest' && matrix.features == '--no-default-features' }}
# with:
# command: clippy
# args: --verbose --all-targets -p benchmarks
- name: Check rumqttc and rumqttd
run: cargo hack clippy --verbose --each-feature --no-dev-deps --optional-deps url -p rumqttc -p rumqttd
- name: Check docs
if: ${{ matrix.os != 'windows-latest' }}
run: cargo hack doc --verbose --no-deps --each-feature --no-dev-deps --optional-deps url -p rumqttc -p rumqttd
- name: Doctests
run: cargo hack --each-feature --optional-deps url test --doc -p rumqttc -p rumqttd
- name: Test rumqttc and rumqttd
run: |
cargo hack --each-feature --optional-deps url llvm-cov -p rumqttc -p rumqttd --no-report nextest
- name: Combine coverage
run: cargo llvm-cov report --lcov --output-path coverage.lcov
- name: Upload Coverage Report
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./coverage.lcov
parallel: true
flag-name: run-${{ matrix.os }}-cargo
finish-coverage:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Finish Coverage Report
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true