Debian Codegraph @

debian/rust-vendor/hostname/.github/workflows/ci.yml

raw
1 on: push
2 name: Continuous integration
3
4 jobs:
5 lints:
6 name: Lints
7 runs-on: ${{ matrix.os }}
8 strategy:
9 matrix:
10 os:
11 - ubuntu-latest
12 - macOS-latest
13 - windows-latest
14 steps:
15 - uses: actions/checkout@v4
16 - name: Install Rust toolchain
17 uses: dtolnay/rust-toolchain@master
18 with:
19 toolchain: nightly
20 components: rustfmt, clippy
21
22 - name: Run rustfmt
23 if: matrix.os == 'ubuntu-latest'
24 run: |
25 cargo fmt --all -- --check
26
27 - name: Run clippy
28 run: |
29 cargo clippy --locked --all-targets --all-features -- -D warnings
30
31 tier1:
32 # Matches the Rust Tier 1 platform support
33 # See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-1-with-host-tools
34 name: Tier 1
35 runs-on: ${{ matrix.os }}
36 strategy:
37 matrix:
38 include:
39 - os: ubuntu-latest
40 target: aarch64-unknown-linux-gnu
41 use_cross: true
42 - os: ubuntu-latest
43 target: i686-unknown-linux-gnu
44 use_cross: true
45 - os: ubuntu-latest
46 target: x86_64-unknown-linux-gnu
47 # TODO: Enable it back
48 # - os: windows-latest
49 # target: i686-pc-windows-gnu
50 - os: windows-latest
51 target: i686-pc-windows-msvc
52 use_cross: true
53 - os: windows-latest
54 target: x86_64-pc-windows-gnu
55 - os: windows-latest
56 target: x86_64-pc-windows-msvc
57 - os: macos-latest
58 target: x86_64-apple-darwin
59 steps:
60 - uses: actions/checkout@v1
61 - name: Install Rust toolchain
62 uses: dtolnay/rust-toolchain@stable
63 with:
64 targets: ${{ matrix.target }}
65 components: rustfmt
66 - uses: taiki-e/install-action@v2
67 with:
68 tool: cross
69
70 - name: Check without features
71 run: cargo check --locked --target=${{ matrix.target }}
72
73 - name: Check with all features enabled
74 run: ${{ env.CARGO_BINARY }} check --locked --all-features --target=${{ matrix.target }}
75 env:
76 CARGO_BINARY: ${{ matrix.use_cross == true && 'cross' || 'cargo' }}
77
78 - name: Run tests
79 run: ${{ env.CARGO_BINARY }} test --locked --all-features --target=${{ matrix.target }}
80 env:
81 CARGO_BINARY: ${{ matrix.use_cross == true && 'cross' || 'cargo' }}
82
83 tier2_with_host_tools:
84 # Matches Rust "Tier 2 with Host Tools" platform support
85 # For as much as possible
86 #
87 # See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
88 name: Tier 2 (with Host Tools)
89 needs: tier1
90 runs-on: ${{ matrix.os }}
91 strategy:
92 matrix:
93 include:
94 - os: macos-latest
95 target: aarch64-apple-darwin
96 - os: windows-latest
97 target: aarch64-pc-windows-msvc
98 - os: ubuntu-latest
99 target: aarch64-unknown-linux-musl
100 - os: ubuntu-latest
101 target: arm-unknown-linux-gnueabi
102 - os: ubuntu-latest
103 target: arm-unknown-linux-gnueabihf
104 - os: ubuntu-latest
105 target: armv7-unknown-linux-gnueabihf
106 - os: ubuntu-latest
107 target: powerpc-unknown-linux-gnu
108 - os: ubuntu-latest
109 target: powerpc64-unknown-linux-gnu
110 - os: ubuntu-latest
111 target: powerpc64le-unknown-linux-gnu
112 - os: ubuntu-latest
113 target: riscv64gc-unknown-linux-gnu
114 - os: ubuntu-latest
115 target: s390x-unknown-linux-gnu
116 - os: ubuntu-latest
117 target: x86_64-unknown-linux-musl
118 steps:
119 - uses: actions/checkout@v1
120 - name: Install Rust toolchain
121 uses: dtolnay/rust-toolchain@stable
122 with:
123 targets: ${{ matrix.target }}
124 - uses: taiki-e/install-action@v2
125 with:
126 tool: cross
127 - name: Run build
128 run: |
129 cross build --locked --all-features --target=${{ matrix.target }}
130
131 tier2_with_host_tools_via_cross:
132 # Matches Rust "Tier 2 with Host Tools" platform support
133 # For as much as possible, but where `cross` is needed for cross-compilation
134 #
135 # See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
136 name: Tier 2 (with Host Tools, via Cross)
137 needs: tier1
138 runs-on: ubuntu-latest
139 strategy:
140 matrix:
141 target:
142 - x86_64-unknown-freebsd
143 - x86_64-unknown-illumos
144 - x86_64-unknown-netbsd
145 steps:
146 - uses: actions/checkout@v1
147 - name: Install Rust toolchain
148 uses: dtolnay/rust-toolchain@stable
149 with:
150 targets: ${{ matrix.target }}
151 - uses: taiki-e/install-action@v2
152 with:
153 tool: cross
154 - name: Run build
155 run: |
156 cross build --locked --all-features --target=${{ matrix.target }}
157
158 tier2_without_host_tools:
159 # Matches Rust "Tier 2 with host tools" platform support
160 # For as much as possible, but where `cross` is needed for cross-compilation
161 #
162 # See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
163 name: Tier 2 (without Host Tools)
164 needs: tier1
165 runs-on: ${{ matrix.os }}
166 strategy:
167 matrix:
168 include:
169 - os: macos-latest
170 target: aarch64-apple-ios
171 # `rust-std` is not available
172 # - os: ubuntu-latest
173 # target: aarch64-unknown-fuchsia
174 - os: ubuntu-latest
175 target: aarch64-linux-android
176 - os: ubuntu-latest
177 target: arm-linux-androideabi
178 - os: ubuntu-latest
179 target: arm-unknown-linux-musleabi
180 - os: ubuntu-latest
181 target: arm-unknown-linux-musleabihf
182 - os: ubuntu-latest
183 target: armv5te-unknown-linux-gnueabi
184 - os: ubuntu-latest
185 target: armv5te-unknown-linux-musleabi
186 - os: ubuntu-latest
187 target: armv7-linux-androideabi
188 - os: ubuntu-latest
189 target: armv7-unknown-linux-gnueabi
190 - os: ubuntu-latest
191 target: armv7-unknown-linux-musleabi
192 - os: ubuntu-latest
193 target: armv7-unknown-linux-musleabihf
194 - os: ubuntu-latest
195 target: i586-unknown-linux-gnu
196 - os: ubuntu-latest
197 target: i586-unknown-linux-musl
198 - os: ubuntu-latest
199 target: i686-linux-android
200 - os: ubuntu-latest
201 target: i686-unknown-freebsd
202 - os: ubuntu-latest
203 target: i686-unknown-linux-musl
204 - os: ubuntu-latest
205 target: sparc64-unknown-linux-gnu
206 - os: ubuntu-latest
207 target: sparcv9-sun-solaris
208 - os: ubuntu-latest
209 target: thumbv7neon-linux-androideabi
210 - os: ubuntu-latest
211 target: thumbv7neon-unknown-linux-gnueabihf
212 - os: ubuntu-latest
213 target: x86_64-linux-android
214 - os: ubuntu-latest
215 target: x86_64-pc-solaris
216 - os: ubuntu-latest
217 target: x86_64-unknown-linux-gnux32
218 steps:
219 - uses: actions/checkout@v1
220 - name: Install Rust toolchain
221 uses: dtolnay/rust-toolchain@stable
222 with:
223 targets: ${{ matrix.target }}
224 - uses: taiki-e/install-action@v2
225 with:
226 tool: cross
227 - name: Run build
228 run: |
229 cross build --locked --all-features --target=${{ matrix.target }}
230
231 tier2_without_host_tools_default_features:
232 # Matches Rust "Tier 2 with host tools" platform support
233 # For as much as possible, but where `cross` is needed for cross-compilation
234 #
235 # The only difference from the `tier2_without_host_tools` group is that
236 # no optional crate features are enabled (e.g. Redox has `gethostname(2)`, but not the `sethostname(2)`)
237 #
238 # See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
239 name: Tier 2 (without Host Tools)
240 needs: tier1
241 runs-on: ${{ matrix.os }}
242 strategy:
243 matrix:
244 include:
245 - os: ubuntu-latest
246 target: x86_64-unknown-redox
247 steps:
248 - uses: actions/checkout@v1
249 - name: Install Rust toolchain
250 uses: dtolnay/rust-toolchain@stable
251 with:
252 targets: ${{ matrix.target }}
253 - uses: taiki-e/install-action@v2
254 with:
255 tool: cross
256 - name: Run build (default features)
257 run: |
258 cross build --locked --target=${{ matrix.target }}
259
260 msrv:
261 name: MSRV
262 strategy:
263 matrix:
264 include:
265 - os: ubuntu-latest
266 - os: macos-latest
267 - os: windows-latest
268
269 runs-on: ${{ matrix.os }}
270 steps:
271 - uses: actions/checkout@v1
272 - name: Install Rust toolchain
273 uses: dtolnay/rust-toolchain@master
274 with:
275 toolchain: 1.74
276 - name: Check MSRV
277 run: cargo check --locked --lib --all-features