-
Notifications
You must be signed in to change notification settings - Fork 298
187 lines (187 loc) · 5.89 KB
/
main.yml
File metadata and controls
187 lines (187 loc) · 5.89 KB
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
name: CI
on:
push:
branches: [ master, "v0.4.x" ]
pull_request:
branches: [ master, "v0.4.x" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
Test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [stable, msrv-linux, msrv-windows, beta, nightly, macos, windows]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: msrv-linux
os: ubuntu-latest
rust: 1.70.0
- build: msrv-windows
os: windows-latest
rust: 1.70.0
- build: beta
os: ubuntu-latest
rust: beta
- build: nightly
os: ubuntu-latest
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: windows
os: windows-latest
rust: stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
- name: Pin windows-sys for MSRV compatibility
if: matrix.os == 'windows-latest' && matrix.rust == '1.70.0'
run: cargo update -p windows-sys --precise 0.60.2
- name: Run tests
run: cargo hack test --feature-powerset && cargo hack test --feature-powerset --release
Rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
Check:
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-linux-gnu
- aarch64-unknown-linux-musl
- aarch64-unknown-linux-ohos
- aarch64-unknown-netbsd
- aarch64-unknown-openbsd
- aarch64-unknown-redox
- arm-linux-androideabi
- arm64_32-apple-watchos
- armv6k-nintendo-3ds
- armv7-linux-androideabi
- armv7-sony-vita-newlibeabihf
- armv7-unknown-linux-ohos
- i686-linux-android
# Broken, see https://github.com/rust-lang/socket2/issues/539.
#- i686-unknown-hurd-gnu
- i686-unknown-linux-gnu
- sparcv9-sun-solaris
- x86_64-apple-darwin
- x86_64-apple-ios
- x86_64-pc-cygwin
- x86_64-pc-solaris
# Fails with:
# `rror calling dlltool 'x86_64-w64-mingw32-dlltool': No such file or
# directory (os error 2)`, build log:
# <https://github.com/rust-lang/socket2/actions/runs/9577808331/job/26406752150>.
#- 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-illumos
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-ohos
- x86_64-unknown-netbsd
- x86_64-unknown-openbsd
- x86_64-unknown-redox
- wasm32-wasip2
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: taiki-e/install-action@cargo-hack
- name: Check build
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }}
- name: Check docs
run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -Z build-std=std,panic_abort --no-deps --all-features --target ${{ matrix.target }}
Clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
CheckExternalTypes:
name: check-external-types (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
rust:
# `check-external-types` requires a specific Rust nightly version. See
# the README for details: https://github.com/awslabs/cargo-check-external-types
- nightly-2024-06-30
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-check-external-types@0.1.13
locked: true
- name: check-external-types
run: cargo check-external-types --all-features
vmactions:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-freebsd
arch: x86_64
- target: i686-unknown-freebsd
arch: i686
name: FreeBSD/${{ matrix.arch }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Test on FreeBSD
uses: vmactions/freebsd-vm@v1
with:
release: "14.4"
usesh: true
prepare: |
pkg install -y curl cargo-hack
kldload cc_newreno # For the tcp_congestion test
fetch https://sh.rustup.rs -o rustup.sh
sh rustup.sh -y --profile=minimal
. $HOME/.cargo/env
rustup target add ${{ matrix.target }}
run: |
. $HOME/.cargo/env
cargo hack test --target ${{ matrix.target }} --feature-powerset