1
+ name : rustls-mbedcrypto-provider
2
+
3
+ permissions :
4
+ contents : read
5
+
6
+ on :
7
+ pull_request :
8
+ paths-ignore :
9
+ - ' *.md'
10
+ - ' LICENSE'
11
+ branches :
12
+ - master
13
+ merge_group :
14
+ schedule :
15
+ - cron : ' 30 13 * * 1,5'
16
+
17
+ env :
18
+ CARGO_TERM_COLOR : always
19
+ CARGO_NET_RETRY : 10
20
+
21
+ jobs :
22
+ build :
23
+ name : Build+test
24
+ runs-on : ${{ matrix.os }}
25
+ strategy :
26
+ matrix :
27
+ # test a bunch of toolchains on ubuntu
28
+ rust :
29
+ - stable
30
+ - beta
31
+ - nightly
32
+ os : [ubuntu-20.04]
33
+ # but only stable on macos/windows (slower platforms)
34
+ include :
35
+ - os : macos-latest
36
+ rust : stable
37
+ - os : windows-latest
38
+ rust : stable
39
+ steps :
40
+ - name : Checkout sources
41
+ uses : actions/checkout@v4
42
+ with :
43
+ persist-credentials : false
44
+
45
+ - name : Rust Cache
46
+ uses : Swatinem/rust-cache@v2
47
+ with :
48
+ key : ${{ matrix.rust }}-${{ matrix.os }}
49
+
50
+ - name : Install ${{ matrix.rust }} toolchain
51
+ uses : dtolnay/rust-toolchain@master
52
+ with :
53
+ toolchain : ${{ matrix.rust }}
54
+
55
+ - name : cargo build (debug; default features)
56
+ run : cargo build --locked
57
+ shell : bash
58
+
59
+ - name : cargo test (debug; all features)
60
+ run : cargo test --locked --all-features
61
+ shell : bash
62
+ env :
63
+ RUST_BACKTRACE : 1
64
+
65
+ features :
66
+ name : Features
67
+ runs-on : ubuntu-latest
68
+ steps :
69
+ - name : Checkout sources
70
+ uses : actions/checkout@v4
71
+ with :
72
+ persist-credentials : false
73
+
74
+ - name : Rust Cache
75
+ uses : Swatinem/rust-cache@v2
76
+
77
+ - name : Install stable toolchain
78
+ uses : dtolnay/rust-toolchain@stable
79
+
80
+ - name : cargo build (debug; default features)
81
+ run : cargo build --locked
82
+
83
+ - name : cargo test (debug; default features)
84
+ run : cargo test --locked
85
+ env :
86
+ RUST_BACKTRACE : 1
87
+
88
+ - name : cargo test (debug; no default features)
89
+ run : cargo test --locked --no-default-features
90
+
91
+ - name : cargo test (rustls_mbedcrypto_provider; debug; no default features; tls12)
92
+ run : cargo test --locked --no-default-features --features tls12 --package rustls-mbedcrypto-provider
93
+
94
+ - name : cargo test (rustls_mbedcrypto_provider; debug; no default features; tls12, rdrand)
95
+ run : cargo test --locked --no-default-features --features tls12,rdrand --package rustls-mbedcrypto-provider
96
+
97
+ - name : cargo test (release; no run)
98
+ run : cargo test --locked --release --no-run
99
+
100
+ # TODO: add fuzz tests
101
+ # TODO: add benchmarks
102
+
103
+ docs :
104
+ name : Check for documentation errors
105
+ runs-on : ubuntu-20.04
106
+ steps :
107
+ - name : Checkout sources
108
+ uses : actions/checkout@v4
109
+ with :
110
+ persist-credentials : false
111
+
112
+ - name : Install rust toolchain
113
+ uses : dtolnay/rust-toolchain@nightly
114
+
115
+ - name : cargo doc (all packages; all features)
116
+ run : cargo doc --locked --all-features --no-deps --document-private-items
117
+ env :
118
+ RUSTDOCFLAGS : -Dwarnings
119
+
120
+ coverage :
121
+ name : Measure coverage
122
+ runs-on : ubuntu-20.04
123
+ steps :
124
+ - name : Checkout sources
125
+ uses : actions/checkout@v4
126
+ with :
127
+ persist-credentials : false
128
+
129
+ - name : Rust Cache
130
+ uses : Swatinem/rust-cache@v2
131
+
132
+ - name : Install rust toolchain
133
+ uses : dtolnay/rust-toolchain@stable
134
+ with :
135
+ components : llvm-tools
136
+
137
+ - name : Install cargo-llvm-cov
138
+ run : cargo install cargo-llvm-cov
139
+
140
+ - name : Measure coverage
141
+ run : ./admin/coverage --lcov --output-path final.info
142
+
143
+ - name : Report to codecov.io
144
+ uses : codecov/codecov-action@v3
145
+ with :
146
+ file : final.info
147
+ fail_ci_if_error : false
148
+
149
+ # TODO: enable this after crate is published
150
+ # semver:
151
+ # name: Check semver compatibility
152
+ # runs-on: ubuntu-latest
153
+ # steps:
154
+ # - name: Checkout sources
155
+ # uses: actions/checkout@v4
156
+ # with:
157
+ # persist-credentials: false
158
+
159
+ # - name: Check semver
160
+ # uses: obi1kenobi/cargo-semver-checks-action@v2
161
+
162
+ format :
163
+ name : Format
164
+ runs-on : ubuntu-latest
165
+ steps :
166
+ - name : Checkout sources
167
+ uses : actions/checkout@v4
168
+ with :
169
+ persist-credentials : false
170
+ - name : Install rust toolchain
171
+ uses : dtolnay/rust-toolchain@stable
172
+ with :
173
+ components : rustfmt
174
+ - name : Check formatting
175
+ run : cargo fmt --all -- --check
176
+
177
+ clippy :
178
+ name : Clippy
179
+ runs-on : ubuntu-latest
180
+ steps :
181
+ - name : Checkout sources
182
+ uses : actions/checkout@v4
183
+ with :
184
+ persist-credentials : false
185
+
186
+ - name : Rust Cache
187
+ uses : Swatinem/rust-cache@v2
188
+
189
+ - name : Install rust toolchain
190
+ uses : dtolnay/rust-toolchain@stable
191
+ with :
192
+ components : clippy
193
+ - run : cargo clippy --locked --package rustls-mbedcrypto-provider --all-features --all-targets -- --deny warnings
194
+ - run : cargo clippy --locked --package rustls-mbedcrypto-provider --no-default-features --all-targets -- --deny warnings
195
+
196
+ clippy-nightly :
197
+ name : Clippy (Nightly)
198
+ runs-on : ubuntu-latest
199
+ steps :
200
+ - name : Checkout sources
201
+ uses : actions/checkout@v4
202
+ with :
203
+ persist-credentials : false
204
+
205
+ - name : Rust Cache
206
+ uses : Swatinem/rust-cache@v2
207
+
208
+ - name : Install rust toolchain
209
+ uses : dtolnay/rust-toolchain@nightly
210
+ with :
211
+ components : clippy
212
+ - run : cargo clippy --locked --package rustls-mbedcrypto-provider --all-features --all-targets
213
+ - run : cargo clippy --locked --package rustls-mbedcrypto-provider --no-default-features --all-targets
0 commit comments