-
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (133 loc) · 4.37 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-examples:
name: Test examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@just
# protoc is needed to build examples that have grpc enabled
- uses: taiki-e/install-action@protoc
- name: Test
run: just test-examples
test-private:
name: Test private
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@just
- name: Test
run: just test-private
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@nextest
# protoc is needed to build examples that have grpc enabled
- uses: taiki-e/install-action@protoc
- name: Test
run: cargo hack nextest run --no-fail-fast --each-feature --clean-per-run --log-group github-actions
doc_test:
name: Doc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
# protoc is needed to build examples that have grpc enabled
- uses: taiki-e/install-action@protoc
- name: Doc test
run: cargo hack test --doc --no-fail-fast --each-feature --log-group github-actions
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
# protoc is needed to build examples that have grpc enabled
- uses: taiki-e/install-action@protoc
- name: Check
run: cargo hack check --each-feature --no-dev-deps --log-group github-actions
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
# protoc is needed to build examples that have grpc enabled
- uses: taiki-e/install-action@protoc
- name: Clippy
run: cargo hack clippy --all-targets --each-feature --log-group github-actions -- -D warnings
deny:
name: Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
arguments: --all-features
command-arguments: "-A duplicate advisories ban sources"
# https://doc.rust-lang.org/cargo/guide/continuous-integration.html#verifying-rust-version
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --rust-version --all-targets --ignore-private --log-group github-actions
# https://doc.rust-lang.org/cargo/guide/continuous-integration.html#verifying-rust-version
minimal_direct_deps:
name: Direct dep min version check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- run: cargo minimal-versions check --direct --all-features
check_formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Formatting
run: cargo fmt --all --check
check_docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Docs
env:
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private_intra_doc_links"
run: cargo doc --all-features