|
21 | 21 | defaults:
|
22 | 22 | run:
|
23 | 23 | shell: bash
|
24 |
| - |
25 |
| -jobs: |
26 |
| - style_check: |
27 |
| - name: Style check |
28 |
| - runs-on: ubuntu-24.04 |
29 |
| - timeout-minutes: 10 |
30 |
| - steps: |
31 |
| - - uses: actions/checkout@v4 |
32 |
| - - name: Setup Rust toolchain |
33 |
| - run: ./ci/install-rust.sh && rustup component add rustfmt |
34 |
| - - name: Check style |
35 |
| - run: ./ci/style.sh |
36 |
| - |
37 |
| - clippy: |
38 |
| - name: Clippy on ${{ matrix.os }} |
39 |
| - strategy: |
40 |
| - matrix: |
41 |
| - os: [ubuntu-24.04, macos-15, windows-2022] |
42 |
| - runs-on: ${{ matrix.os }} |
43 |
| - timeout-minutes: 10 |
44 |
| - steps: |
45 |
| - - uses: actions/checkout@v4 |
46 |
| - - run: rustup update stable --no-self-update |
47 |
| - - uses: Swatinem/rust-cache@v2 |
48 |
| - # Here we use the latest stable Rust toolchain already installed by GitHub |
49 |
| - # Ideally we should run it for every target, but we cannot rely on unstable toolchains |
50 |
| - # due to Clippy not being consistent between them. |
51 |
| - - run: cargo clippy --workspace --exclude libc-test --exclude ctest-test --all-targets -- -D warnings |
52 |
| - |
53 |
| - # This runs `cargo build --target ...` for all T1 and T2 targets` |
54 |
| - verify_build: |
55 |
| - name: Verify build |
56 |
| - strategy: |
57 |
| - matrix: |
58 |
| - toolchain: [stable, nightly, 1.63.0] |
59 |
| - os: [ubuntu-24.04, macos-15, windows-2022] |
60 |
| - include: |
61 |
| - - toolchain: beta |
62 |
| - os: ubuntu-24.04 |
63 |
| - runs-on: ${{ matrix.os }} |
64 |
| - timeout-minutes: 25 |
65 |
| - env: |
66 |
| - TOOLCHAIN: ${{ matrix.toolchain }} |
67 |
| - steps: |
68 |
| - - uses: actions/checkout@v4 |
69 |
| - - name: Setup Rust toolchain |
70 |
| - run: ./ci/install-rust.sh |
71 |
| - |
72 |
| - - name: Install semver-checks |
73 |
| - uses: taiki-e/install-action@cargo-semver-checks |
74 |
| - if: matrix.toolchain == 'stable' |
75 |
| - |
76 |
| - # FIXME(ci): These `du` statements are temporary for debugging cache |
77 |
| - - name: Target size before restoring cache |
78 |
| - run: du -sh target | sort -k 2 || true |
79 |
| - - uses: Swatinem/rust-cache@v2 |
80 |
| - with: |
81 |
| - key: ${{ matrix.os }}-${{ matrix.toolchain }} |
82 |
| - - name: Target size after restoring cache |
83 |
| - run: du -sh target | sort -k 2 || true |
84 |
| - |
85 |
| - - name: Execute build.sh |
86 |
| - run: | |
87 |
| - set -eux |
88 |
| - if [ "${{ matrix.toolchain }}" = "1.63.0" ]; then |
89 |
| - # Remove `-Dwarnings` at the MSRV since lints may be different |
90 |
| - export RUSTFLAGS="" |
91 |
| - # Remove `ctest-next` which uses the 2024 edition |
92 |
| - perl -i -ne 'print unless /"ctest-(next|test)",/ || /"libc-test",/' Cargo.toml |
93 |
| - fi |
94 |
| -
|
95 |
| - ./ci/verify-build.sh |
96 |
| - - name: Target size after job completion |
97 |
| - run: du -sh target | sort -k 2 |
98 |
| - |
99 |
| - test_tier1: |
100 |
| - name: Test tier1 |
101 |
| - strategy: |
102 |
| - matrix: |
103 |
| - include: |
104 |
| - - target: i686-unknown-linux-gnu |
105 |
| - docker: true |
106 |
| - os: ubuntu-24.04 |
107 |
| - - target: i686-unknown-linux-gnu |
108 |
| - docker: true |
109 |
| - os: ubuntu-24.04 |
110 |
| - artifact-tag: offset-bits64 |
111 |
| - env: |
112 |
| - RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 |
113 |
| - - target: i686-unknown-linux-gnu |
114 |
| - docker: true |
115 |
| - os: ubuntu-24.04 |
116 |
| - artifact-tag: time-bits64 |
117 |
| - env: |
118 |
| - RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 |
119 |
| - - target: x86_64-unknown-linux-gnu |
120 |
| - docker: true |
121 |
| - os: ubuntu-24.04 |
122 |
| - - target: aarch64-apple-darwin |
123 |
| - os: macos-15 |
124 |
| - - target: x86_64-pc-windows-gnu |
125 |
| - os: windows-2022 |
126 |
| - env: |
127 |
| - ARCH_BITS: 64 |
128 |
| - ARCH: x86_64 |
129 |
| - - target: x86_64-pc-windows-msvc |
130 |
| - os: windows-2022 |
131 |
| - # FIXME: It currently causes segfaults. |
132 |
| - #- target: i686-pc-windows-gnu |
133 |
| - # env: |
134 |
| - # ARCH_BITS: 32 |
135 |
| - # ARCH: i686 |
136 |
| - - target: i686-pc-windows-msvc |
137 |
| - os: windows-2022 |
138 |
| - runs-on: ${{ matrix.os }} |
139 |
| - timeout-minutes: 25 |
140 |
| - env: |
141 |
| - TARGET: ${{ matrix.target }} |
142 |
| - steps: |
143 |
| - - uses: actions/checkout@v4 |
144 |
| - - name: Setup Rust toolchain |
145 |
| - run: ./ci/install-rust.sh |
146 |
| - - uses: Swatinem/rust-cache@v2 |
147 |
| - with: |
148 |
| - key: ${{ matrix.target }} |
149 |
| - |
150 |
| - - name: Add matrix env variables to the environment |
151 |
| - if: matrix.env |
152 |
| - run: | |
153 |
| - echo '${{ toJson(matrix.env) }}' | |
154 |
| - jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV |
155 |
| - shell: bash |
156 |
| - |
157 |
| - - name: Run natively |
158 |
| - if: "!matrix.docker" |
159 |
| - run: ./ci/run.sh ${{ matrix.target }} |
160 |
| - - name: Run in Docker |
161 |
| - if: "matrix.docker" |
162 |
| - run: ./ci/run-docker.sh ${{ matrix.target }} |
163 |
| - |
164 |
| - - name: Create CI artifacts |
165 |
| - id: create_artifacts |
166 |
| - if: always() |
167 |
| - run: ./ci/create-artifacts.py |
168 |
| - - uses: actions/upload-artifact@v4 |
169 |
| - if: always() && steps.create_artifacts.outcome == 'success' |
170 |
| - with: |
171 |
| - name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }} |
172 |
| - path: ${{ env.ARCHIVE_PATH }} |
173 |
| - retention-days: 5 |
174 |
| - |
175 |
| - test_tier2: |
176 |
| - name: Test tier2 |
177 |
| - needs: [test_tier1, style_check] |
178 |
| - runs-on: ubuntu-24.04 |
179 |
| - strategy: |
180 |
| - fail-fast: true |
181 |
| - max-parallel: 12 |
182 |
| - matrix: |
183 |
| - target: |
184 |
| - # FIXME(sparc): this takes much longer to run than any other job, put |
185 |
| - # it first to make sure it gets a head start. |
186 |
| - - sparc64-unknown-linux-gnu |
187 |
| - - aarch64-linux-android |
188 |
| - - aarch64-unknown-linux-gnu |
189 |
| - - aarch64-unknown-linux-musl |
190 |
| - - arm-linux-androideabi |
191 |
| - - arm-unknown-linux-musleabihf |
192 |
| - # FIXME(#4297): Disabled due to spurious failueSome android jobs are disabled because of high rates of |
193 |
| - # - i686-linux-android |
194 |
| - - i686-unknown-linux-musl |
195 |
| - - loongarch64-unknown-linux-gnu |
196 |
| - - loongarch64-unknown-linux-musl |
197 |
| - - powerpc64-unknown-linux-gnu |
198 |
| - - powerpc64le-unknown-linux-gnu |
199 |
| - - powerpc64le-unknown-linux-musl |
200 |
| - - riscv64gc-unknown-linux-gnu |
201 |
| - - s390x-unknown-linux-gnu |
202 |
| - - wasm32-unknown-emscripten |
203 |
| - - wasm32-wasip1 |
204 |
| - - wasm32-wasip2 |
205 |
| - - x86_64-linux-android |
206 |
| - # FIXME: Exec format error (os error 8) |
207 |
| - # - x86_64-unknown-linux-gnux32 |
208 |
| - - x86_64-unknown-linux-musl |
209 |
| - # FIXME: It seems some items in `src/unix/mod.rs` |
210 |
| - # aren't defined on redox actually. |
211 |
| - # - x86_64-unknown-redox |
212 |
| - include: |
213 |
| - - target: arm-unknown-linux-gnueabihf |
214 |
| - - target: arm-unknown-linux-gnueabihf |
215 |
| - env: |
216 |
| - RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 |
217 |
| - artifact-tag: offset-bits64 |
218 |
| - - target: arm-unknown-linux-gnueabihf |
219 |
| - env: |
220 |
| - RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 |
221 |
| - artifact-tag: time-bits64 |
222 |
| - - target: aarch64-unknown-linux-musl |
223 |
| - env: |
224 |
| - RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 |
225 |
| - - target: arm-unknown-linux-musleabihf |
226 |
| - env: |
227 |
| - RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 |
228 |
| - - target: i686-unknown-linux-musl |
229 |
| - env: |
230 |
| - RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 |
231 |
| - - target: loongarch64-unknown-linux-musl |
232 |
| - env: |
233 |
| - RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 |
234 |
| - - target: powerpc64le-unknown-linux-musl |
235 |
| - env: |
236 |
| - RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 |
237 |
| - # FIXME(ppc): SIGILL running tests, see |
238 |
| - # https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713 |
239 |
| - # - target: powerpc-unknown-linux-gnu |
240 |
| - # - target: powerpc-unknown-linux-gnu |
241 |
| - # env: |
242 |
| - # RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 |
243 |
| - # artifact-tag: offset-bits64 |
244 |
| - # - target: powerpc-unknown-linux-gnu |
245 |
| - # env: |
246 |
| - # RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 |
247 |
| - # artifact-tag: time-bits64 |
248 |
| - timeout-minutes: 25 |
249 |
| - env: |
250 |
| - TARGET: ${{ matrix.target }} |
251 |
| - steps: |
252 |
| - - uses: actions/checkout@v4 |
253 |
| - - name: Setup Rust toolchain |
254 |
| - run: ./ci/install-rust.sh |
255 |
| - - uses: Swatinem/rust-cache@v2 |
256 |
| - with: |
257 |
| - key: ${{ matrix.target }} |
258 |
| - |
259 |
| - - name: Add matrix env variables to the environment |
260 |
| - if: matrix.env |
261 |
| - run: | |
262 |
| - echo '${{ toJson(matrix.env) }}' | |
263 |
| - jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV |
264 |
| - shell: bash |
265 |
| - |
266 |
| - - name: Execute run-docker.sh |
267 |
| - run: ./ci/run-docker.sh ${{ matrix.target }} |
268 |
| - |
269 |
| - - name: Create CI artifacts |
270 |
| - id: create_artifacts |
271 |
| - if: always() |
272 |
| - run: ./ci/create-artifacts.py |
273 |
| - - uses: actions/upload-artifact@v4 |
274 |
| - if: always() && steps.create_artifacts.outcome == 'success' |
275 |
| - with: |
276 |
| - name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }} |
277 |
| - path: ${{ env.ARCHIVE_PATH }} |
278 |
| - retention-days: 5 |
279 |
| - |
280 |
| - test_tier2_vm: |
281 |
| - name: Test tier2 VM |
282 |
| - needs: [test_tier1, style_check] |
283 |
| - runs-on: ubuntu-latest |
284 |
| - strategy: |
285 |
| - fail-fast: true |
286 |
| - matrix: |
287 |
| - target: |
288 |
| - - x86_64-pc-solaris |
289 |
| - timeout-minutes: 25 |
290 |
| - steps: |
291 |
| - - uses: actions/checkout@v4 |
292 |
| - - name: test on Solaris |
293 |
| - |
294 |
| - with: |
295 |
| - release: "11.4-gcc" |
296 |
| - usesh: true |
297 |
| - mem: 4096 |
298 |
| - copyback: false |
299 |
| - prepare: | |
300 |
| - set -x |
301 |
| - source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install) |
302 |
| - rustc --version |
303 |
| - uname -a |
304 |
| - run: | |
305 |
| - export PATH=$HOME/.rust_solaris/bin:$PATH |
306 |
| - ./ci/run.sh ${{ matrix.target }} |
307 |
| -
|
308 |
| - ctest_msrv: |
309 |
| - name: Check MSRV |
310 |
| - runs-on: ubuntu-24.04 |
311 |
| - timeout-minutes: 10 |
312 |
| - env: |
313 |
| - RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings` |
314 |
| - steps: |
315 |
| - - uses: actions/checkout@master |
316 |
| - - run: | |
317 |
| - msrv="$(cargo metadata --format-version 1 | jq -r --arg CRATE_NAME ctest '.packages | map(select(.name == $CRATE_NAME)) | first | .rust_version')" |
318 |
| - echo "MSRV: $msrv" |
319 |
| - echo "MSRV=$msrv" >> "$GITHUB_ENV" |
320 |
| - - name: Install Rust |
321 |
| - run: rustup update "$MSRV" --no-self-update && rustup default "$MSRV" |
322 |
| - - name: Remove edition 2024 crates |
323 |
| - run: perl -i -ne 'print unless /"ctest-(next|test)",/ || /"libc-test",/' Cargo.toml |
324 |
| - - uses: Swatinem/rust-cache@v2 |
325 |
| - - run: cargo build -p ctest |
326 |
| - |
327 |
| - docs: |
328 |
| - name: Ensure docs build |
329 |
| - runs-on: ubuntu-24.04 |
330 |
| - timeout-minutes: 10 |
331 |
| - steps: |
332 |
| - - uses: actions/checkout@master |
333 |
| - - name: Install Rust |
334 |
| - run: rustup update nightly --no-self-update && rustup default nightly |
335 |
| - - uses: Swatinem/rust-cache@v2 |
336 |
| - - run: cargo doc --workspace --no-deps |
337 |
| - |
338 |
| - # One job that "summarizes" the success state of this pipeline. This can then be added to branch |
339 |
| - # protection, rather than having to add each job separately. |
340 |
| - success: |
341 |
| - name: success |
342 |
| - runs-on: ubuntu-24.04 |
343 |
| - needs: |
344 |
| - - style_check |
345 |
| - - test_tier1 |
346 |
| - - test_tier2 |
347 |
| - - test_tier2_vm |
348 |
| - - verify_build |
349 |
| - - ctest_msrv |
350 |
| - - docs |
351 |
| - - clippy |
352 |
| - # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency |
353 |
| - # failed" as success. So we have to do some contortions to ensure the job fails if any of its |
354 |
| - # dependencies fails. |
355 |
| - if: always() # make sure this is never "skipped" |
356 |
| - steps: |
357 |
| - # Manually check the status of all dependencies. `if: failure()` does not work. |
358 |
| - - name: check if any dependency failed |
359 |
| - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments