-
Notifications
You must be signed in to change notification settings - Fork 738
215 lines (213 loc) · 6.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: CI
on:
push:
branches: [ "master", "v0.7.x", "v0.8.x" ]
pull_request:
branches: [ "master", "v0.7.x", "v0.8.x" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
CI: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
Test:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install Cargo-hack
run: cargo install --debug cargo-hack
- name: Check all features
run: cargo hack check --feature-powerset
- name: Tests
run: cargo test --all-features
- name: Tests release build
run: cargo test --release --all-features
TestPoll:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RUSTFLAGS: "--cfg mio_unsupported_force_poll_poll"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Tests
run: cargo test --all-features
- name: Tests release build
run: cargo test --release --all-features
TestWakerPipe:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RUSTFLAGS: "--cfg mio_unsupported_force_waker_pipe"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Tests
run: cargo test --all-features
- name: Tests release build
run: cargo test --release --all-features
MinimalVersions:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Install minimal verions
run: cargo update -Zminimal-versions
- name: Tests
run: cargo test --all-features
MSRV:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
# NOTE: full version (including .0) to work around
# <https://github.com/dtolnay/rust-toolchain/issues/112>.
toolchain: 1.70.0
- name: Check
# We only run check allowing us to use newer features in tests.
run: cargo check --all-features
Nightly:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Tests
run: cargo test --all-features
Clippy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Clippy
run: cargo clippy --all-targets --all-features -- --allow clippy::mixed-attributes-style --allow clippy::unused-io-amount -D warnings
Docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check docs
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
Rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
# FIXME: for some reason this doesn't actually check all files.
# So instead we run `rustfmt` directly on each file.
#cargo fmt --all -- --check
run: find src tests examples -type f -iname "*.rs" | xargs rustfmt --check
CheckTargets:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
target:
- aarch64-apple-darwin
- aarch64-apple-ios
- aarch64-apple-tvos
- aarch64-apple-visionos
- aarch64-apple-watchos
- aarch64-linux-android
- aarch64-unknown-freebsd
- aarch64-unknown-fuchsia
- aarch64-unknown-hermit
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- aarch64-unknown-netbsd
- aarch64-unknown-nto-qnx710
- aarch64-unknown-openbsd
- aarch64-unknown-redox
- arm-linux-androideabi
- arm64_32-apple-watchos
- armv7-sony-vita-newlibeabihf
- i686-unknown-linux-gnu
- i686-unknown-hurd-gnu
# - powerpc64-ibm-aix Enable CI runs once aix has full stdlib upstreamed
- riscv32imc-esp-espidf
- sparcv9-sun-solaris
- wasm32-wasi
- x86_64-apple-darwin
- x86_64-apple-ios
- x86_64-pc-nto-qnx710
- x86_64-pc-solaris
# TODO: solve the following err:
# `Error calling dlltool 'x86_64-w64-mingw32-dlltool'`, build log:
# <https://github.com/tokio-rs/mio/actions/runs/9436499623/job/25991326487?pr=1794>.
#- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-dragonfly
- x86_64-unknown-freebsd
- x86_64-unknown-fuchsia
- x86_64-unknown-haiku
- x86_64-unknown-hermit
- x86_64-unknown-illumos
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-unknown-netbsd
- x86_64-unknown-openbsd
- x86_64-unknown-redox
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: taiki-e/install-action@cargo-hack
- name: Run check
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }}
Sanitizer:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
sanitizer: [address, leak, memory, thread]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Add rust source
run: rustup component add rust-src
- name: Run tests with sanitizer
run: make test_sanitizer SAN=${{ matrix.sanitizer }}
# Single job required to merge the pr.
Passed:
runs-on: ubuntu-latest
needs:
- Test
- TestPoll
- MinimalVersions
- MSRV
- Nightly
- Clippy
- Docs
- Rustfmt
- CheckTargets
steps:
- run: exit 0