|
| 1 | +name: full CI |
| 2 | + |
| 3 | +on: |
| 4 | + merge_group: |
| 5 | + push: |
| 6 | + branches: ['main', 'libc-0.2'] |
| 7 | + |
| 8 | +jobs: |
| 9 | + docker_linux_tier1: |
| 10 | + permissions: |
| 11 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 12 | + contents: read # to fetch code (actions/checkout) |
| 13 | + |
| 14 | + name: Docker Linux Tier1 |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + strategy: |
| 17 | + fail-fast: true |
| 18 | + matrix: |
| 19 | + target: [ |
| 20 | + i686-unknown-linux-gnu, |
| 21 | + x86_64-unknown-linux-gnu, |
| 22 | + ] |
| 23 | + steps: |
| 24 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 25 | + with: |
| 26 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: Setup Rust toolchain |
| 29 | + run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh |
| 30 | + - name: Execute run-docker.sh |
| 31 | + run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} |
| 32 | + |
| 33 | + macos: |
| 34 | + permissions: |
| 35 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 36 | + contents: read # to fetch code (actions/checkout) |
| 37 | + |
| 38 | + name: macOS |
| 39 | + runs-on: macos-13 |
| 40 | + strategy: |
| 41 | + fail-fast: true |
| 42 | + matrix: |
| 43 | + target: [ |
| 44 | + x86_64-apple-darwin, |
| 45 | + ] |
| 46 | + steps: |
| 47 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 48 | + with: |
| 49 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - name: Setup Rust toolchain |
| 52 | + run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh |
| 53 | + - name: Execute run.sh |
| 54 | + run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} |
| 55 | + |
| 56 | + windows: |
| 57 | + permissions: |
| 58 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 59 | + contents: read # to fetch code (actions/checkout) |
| 60 | + |
| 61 | + name: Windows |
| 62 | + runs-on: windows-2022 |
| 63 | + env: |
| 64 | + OS: windows |
| 65 | + strategy: |
| 66 | + fail-fast: true |
| 67 | + matrix: |
| 68 | + include: |
| 69 | + - target: x86_64-pc-windows-gnu |
| 70 | + env: |
| 71 | + ARCH_BITS: 64 |
| 72 | + ARCH: x86_64 |
| 73 | + - target: x86_64-pc-windows-msvc |
| 74 | + - target: i686-pc-windows-gnu |
| 75 | + env: |
| 76 | + ARCH_BITS: 32 |
| 77 | + ARCH: i686 |
| 78 | + - target: i686-pc-windows-msvc |
| 79 | + steps: |
| 80 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 81 | + with: |
| 82 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + - name: Self-update rustup |
| 85 | + run: rustup self update |
| 86 | + shell: bash |
| 87 | + - name: Setup Rust toolchain |
| 88 | + run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh |
| 89 | + shell: bash |
| 90 | + - name: Execute run.sh |
| 91 | + run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} |
| 92 | + shell: bash |
| 93 | + |
| 94 | + style_check: |
| 95 | + permissions: |
| 96 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 97 | + contents: read # to fetch code (actions/checkout) |
| 98 | + |
| 99 | + name: Style check |
| 100 | + runs-on: ubuntu-22.04 |
| 101 | + steps: |
| 102 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 103 | + with: |
| 104 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 105 | + - uses: actions/checkout@v4 |
| 106 | + - name: Setup Rust toolchain |
| 107 | + run: sh ./ci/install-rust.sh |
| 108 | + - name: Check style |
| 109 | + run: sh ci/style.sh |
| 110 | + |
| 111 | + docker_linux_tier2: |
| 112 | + permissions: |
| 113 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 114 | + contents: read # to fetch code (actions/checkout) |
| 115 | + |
| 116 | + name: Docker Linux Tier2 |
| 117 | + needs: [docker_linux_tier1, style_check] |
| 118 | + runs-on: ubuntu-22.04 |
| 119 | + strategy: |
| 120 | + fail-fast: true |
| 121 | + max-parallel: 12 |
| 122 | + matrix: |
| 123 | + target: [ |
| 124 | + aarch64-linux-android, |
| 125 | + aarch64-unknown-linux-gnu, |
| 126 | + aarch64-unknown-linux-musl, |
| 127 | + arm-linux-androideabi, |
| 128 | + arm-unknown-linux-gnueabihf, |
| 129 | + arm-unknown-linux-musleabihf, |
| 130 | + i686-linux-android, |
| 131 | + i686-unknown-linux-musl, |
| 132 | + powerpc-unknown-linux-gnu, |
| 133 | + powerpc64-unknown-linux-gnu, |
| 134 | + powerpc64le-unknown-linux-gnu, |
| 135 | + s390x-unknown-linux-gnu, |
| 136 | + riscv64gc-unknown-linux-gnu, |
| 137 | + # FIXME: A recent nightly causes a linker failure: |
| 138 | + # https://github.com/rust-lang/rust/issues/76679 |
| 139 | + # See this comment for more details: |
| 140 | + # https://github.com/rust-lang/libc/pull/2225#issuecomment-880696737 |
| 141 | + #wasm32-wasi, |
| 142 | + sparc64-unknown-linux-gnu, |
| 143 | + wasm32-unknown-emscripten, |
| 144 | + x86_64-linux-android, |
| 145 | + # FIXME: Exec format error (os error 8) |
| 146 | + #x86_64-unknown-linux-gnux32, |
| 147 | + x86_64-unknown-linux-musl, |
| 148 | + # FIXME: It seems some items in `src/unix/mod.rs` |
| 149 | + # aren't defined on redox actually. |
| 150 | + # x86_64-unknown-redox, |
| 151 | + ] |
| 152 | + steps: |
| 153 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 154 | + with: |
| 155 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 156 | + - uses: actions/checkout@v4 |
| 157 | + - name: Setup Rust toolchain |
| 158 | + run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh |
| 159 | + - name: Execute run-docker.sh |
| 160 | + run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} |
| 161 | + |
| 162 | + # These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std. |
| 163 | + # Because of this, only the nightly compiler can be used on these targets. |
| 164 | + docker_linux_build_std: |
| 165 | + permissions: |
| 166 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 167 | + contents: read # to fetch code (actions/checkout) |
| 168 | + |
| 169 | + if: ${{ false }} # This is currently broken |
| 170 | + name: Docker Linux Build-Std Targets |
| 171 | + needs: [docker_linux_tier1, style_check] |
| 172 | + runs-on: ubuntu-22.04 |
| 173 | + strategy: |
| 174 | + fail-fast: true |
| 175 | + max-parallel: 12 |
| 176 | + matrix: |
| 177 | + target: [ |
| 178 | + armv7-unknown-linux-uclibceabihf |
| 179 | + ] |
| 180 | + steps: |
| 181 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 182 | + with: |
| 183 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 184 | + - uses: actions/checkout@v4 |
| 185 | + - name: Setup Rust toolchain |
| 186 | + run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh |
| 187 | + - name: Execute run-docker.sh |
| 188 | + run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }} |
| 189 | + |
| 190 | + # devkitpro's pacman needs to be connected from Docker. |
| 191 | + docker_switch: |
| 192 | + permissions: |
| 193 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 194 | + contents: read # to fetch code (actions/checkout) |
| 195 | + |
| 196 | + name: Docker Switch |
| 197 | + needs: [docker_linux_tier1, style_check] |
| 198 | + runs-on: ubuntu-22.04 |
| 199 | + steps: |
| 200 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 201 | + with: |
| 202 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 203 | + - uses: actions/checkout@v4 |
| 204 | + - name: Setup Rust toolchain |
| 205 | + run: sh ./ci/install-rust.sh |
| 206 | + - name: Execute run-docker.sh |
| 207 | + run: LIBC_CI=1 sh ./ci/run-docker.sh switch |
| 208 | + |
| 209 | + build_channels_linux: |
| 210 | + permissions: |
| 211 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 212 | + contents: read # to fetch code (actions/checkout) |
| 213 | + |
| 214 | + name: Build Channels Linux |
| 215 | + needs: docker_linux_tier2 |
| 216 | + runs-on: ubuntu-22.04 |
| 217 | + env: |
| 218 | + OS: linux |
| 219 | + strategy: |
| 220 | + fail-fast: true |
| 221 | + max-parallel: 5 |
| 222 | + matrix: |
| 223 | + toolchain: [ |
| 224 | + stable, |
| 225 | + beta, |
| 226 | + nightly, |
| 227 | + # FIXME: Disabled due to: |
| 228 | + # error: failed to parse registry's information for: serde |
| 229 | + #1.13.0, |
| 230 | + 1.19.0, |
| 231 | + 1.24.0, |
| 232 | + 1.25.0, |
| 233 | + 1.30.0, |
| 234 | + ] |
| 235 | + steps: |
| 236 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 237 | + with: |
| 238 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 239 | + - uses: actions/checkout@v4 |
| 240 | + - name: Setup Rust toolchain |
| 241 | + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh |
| 242 | + - name: Execute build.sh |
| 243 | + run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh |
| 244 | + |
| 245 | + build_channels_macos: |
| 246 | + permissions: |
| 247 | + contents: read # to fetch code (actions/checkout) |
| 248 | + |
| 249 | + name: Build Channels macOS |
| 250 | + needs: macos |
| 251 | + env: |
| 252 | + OS: macos |
| 253 | + strategy: |
| 254 | + fail-fast: true |
| 255 | + max-parallel: 4 |
| 256 | + matrix: |
| 257 | + target: |
| 258 | + - { toolchain: stable, os: macos-13 } |
| 259 | + - { toolchain: beta, os: macos-13 } |
| 260 | + - { toolchain: nightly, os: macos-13 } |
| 261 | + # Use macOS 11 for older toolchains as newer Xcode donesn't work well. |
| 262 | + # FIXME: Disabled due to: |
| 263 | + # error: failed to parse registry's information for: serde |
| 264 | + #- { toolchain: 1.13.0, os: macos-11 } |
| 265 | + - { toolchain: 1.19.0, os: macos-11 } |
| 266 | + - { toolchain: 1.24.0, os: macos-11 } |
| 267 | + - { toolchain: 1.25.0, os: macos-11 } |
| 268 | + - { toolchain: 1.30.0, os: macos-11 } |
| 269 | + runs-on: ${{ matrix.target.os }} |
| 270 | + steps: |
| 271 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 272 | + with: |
| 273 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 274 | + - uses: actions/checkout@v4 |
| 275 | + - name: Setup Rust toolchain |
| 276 | + run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh |
| 277 | + - name: Execute build.sh |
| 278 | + run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh |
| 279 | + |
| 280 | + build_channels_windows: |
| 281 | + permissions: |
| 282 | + contents: read # to fetch code (actions/checkout) |
| 283 | + |
| 284 | + name: Build Channels Windows |
| 285 | + runs-on: windows-2022 |
| 286 | + env: |
| 287 | + OS: windows |
| 288 | + strategy: |
| 289 | + fail-fast: true |
| 290 | + matrix: |
| 291 | + toolchain: [ |
| 292 | + 1.19.0, |
| 293 | + 1.24.0, |
| 294 | + 1.25.0, |
| 295 | + 1.30.0, |
| 296 | + stable, |
| 297 | + ] |
| 298 | + steps: |
| 299 | + - uses: actions/checkout@v4 |
| 300 | + - name: Self-update rustup |
| 301 | + run: rustup self update |
| 302 | + shell: bash |
| 303 | + - name: Execute build.sh |
| 304 | + run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh |
| 305 | + shell: bash |
| 306 | + |
| 307 | + check_cfg: |
| 308 | + permissions: |
| 309 | + actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) |
| 310 | + contents: read # to fetch code (actions/checkout) |
| 311 | + |
| 312 | + name: "Check #[cfg]s" |
| 313 | + runs-on: ubuntu-22.04 |
| 314 | + steps: |
| 315 | + - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD |
| 316 | + with: |
| 317 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 318 | + - uses: actions/checkout@v4 |
| 319 | + - name: Setup Rust toolchain |
| 320 | + run: TOOLCHAIN=nightly sh ./ci/install-rust.sh |
| 321 | + - name: Build with check-cfg |
| 322 | + run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg |
| 323 | + |
| 324 | + # One job that "summarizes" the success state of this pipeline. This can then be added to branch |
| 325 | + # protection, rather than having to add each job separately. |
| 326 | + success: |
| 327 | + name: Success |
| 328 | + runs-on: ubuntu-latest |
| 329 | + needs: [ |
| 330 | + docker_linux_tier1, |
| 331 | + docker_linux_tier2, |
| 332 | + #docker_linux_build_std, |
| 333 | + macos, |
| 334 | + windows, |
| 335 | + style_check, |
| 336 | + docker_switch, |
| 337 | + build_channels_linux, |
| 338 | + build_channels_macos, |
| 339 | + build_channels_windows, |
| 340 | + ] |
| 341 | + # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency |
| 342 | + # failed" as success. So we have to do some contortions to ensure the job fails if any of its |
| 343 | + # dependencies fails. |
| 344 | + if: always() # make sure this is never "skipped" |
| 345 | + steps: |
| 346 | + # Manually check the status of all dependencies. `if: failure()` does not work. |
| 347 | + - name: check if any dependency failed |
| 348 | + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments