Skip to content

Commit

Permalink
Merge pull request #4126 from tgross35/backport-ci-naming
Browse files Browse the repository at this point in the history
[0.2] ci: Naming adjustments and cleanup
  • Loading branch information
tgross35 authored Nov 20, 2024
2 parents 46ebe26 + 7a897dd commit 979575b
Show file tree
Hide file tree
Showing 34 changed files with 220 additions and 311 deletions.
File renamed without changes.
199 changes: 70 additions & 129 deletions .github/workflows/full_ci.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: full CI
name: CI

on:
merge_group:
Expand All @@ -10,152 +10,94 @@ env:
CARGO_TERM_VERBOSE: true
LIBC_CI: 1

defaults:
run:
shell: bash

jobs:
style_check:
name: Style check
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
run: ./ci/install-rust.sh
- name: Check style
run: sh ci/style.sh
run: ./ci/style.sh

build_channels_linux:
name: Build Channels Linux
runs-on: ubuntu-22.04
env:
OS: linux
# This runs `cargo build --target ...` for all T1 and T2 targets`
verify_build:
name: Verify build
strategy:
fail-fast: true
max-parallel: 5
matrix:
toolchain:
- stable
- beta
- nightly
- 1.63.0
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh

build_channels_macos:
name: Build Channels macOS
needs: macos
toolchain: [stable, nightly, 1.63.0]
os: [ubuntu-24.04, macos-14, windows-2022]
include:
- toolchain: beta
os: ubuntu-24.04
runs-on: ${{ matrix.os }}
env:
OS: macos
strategy:
fail-fast: true
max-parallel: 4
matrix:
target:
- { toolchain: stable, os: macos-14 }
- { toolchain: beta, os: macos-14 }
- { toolchain: nightly, os: macos-14 }
- { toolchain: 1.63.0, os: macos-14 }
runs-on: ${{ matrix.target.os }}
TOOLCHAIN: ${{ matrix.toolchain }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
run: ./ci/install-rust.sh
- name: Execute build.sh
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
run: ./ci/verify-build.sh

build_channels_windows:
name: Build Channels Windows
runs-on: windows-2022
env:
OS: windows
strategy:
fail-fast: true
matrix:
toolchain:
- 1.63.0
- stable
steps:
- uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
- name: Execute build.sh
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
shell: bash

macos:
name: macOS
runs-on: macos-14
test_tier1:
name: Test tier1
strategy:
fail-fast: true
matrix:
target:
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
run: sh ./ci/run.sh ${{ matrix.target }}

windows:
name: Windows
runs-on: windows-2022
env:
OS: windows
strategy:
fail-fast: true
matrix:
include:
- target: i686-unknown-linux-gnu
docker: true
os: ubuntu-24.04
- target: x86_64-unknown-linux-gnu
docker: true
os: ubuntu-24.04
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-gnu
os: windows-2022
env:
ARCH_BITS: 64
ARCH: x86_64
- target: x86_64-pc-windows-msvc
os: windows-2022
# FIXME: It currently causes segfaults.
#- target: i686-pc-windows-gnu
# env:
# ARCH_BITS: 32
# ARCH: i686
- target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
shell: bash
- name: Execute run.sh
run: sh ./ci/run.sh ${{ matrix.target }}
shell: bash

docker_linux_tier1:
name: Docker Linux Tier1
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
target:
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
os: windows-2022
runs-on: ${{ matrix.os }}
env:
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: sh ./ci/run-docker.sh ${{ matrix.target }}
run: ./ci/install-rust.sh
- name: Run natively
if: "!matrix.docker"
run: ./ci/run.sh ${{ matrix.target }}
- name: Run in Docker
if: "matrix.docker"
run: ./ci/run-docker.sh ${{ matrix.target }}

docker_linux_tier2:
name: Docker Linux Tier2
needs: [docker_linux_tier1, style_check]
runs-on: ubuntu-22.04
test_tier2:
name: Test tier2
needs: [test_tier1, style_check]
runs-on: ubuntu-24.04
strategy:
fail-fast: true
max-parallel: 12
matrix:
target:
# FIXME(sparc): this takes much longer to run than any other job, put
# it first to make sure it gets a head start.
- sparc64-unknown-linux-gnu
- aarch64-linux-android
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
Expand All @@ -169,28 +111,30 @@ jobs:
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- s390x-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- wasm32-unknown-emscripten
- wasm32-wasip1
- wasm32-wasip2
- sparc64-unknown-linux-gnu
- wasm32-unknown-emscripten
- x86_64-linux-android
# FIXME: Exec format error (os error 8)
# - x86_64-unknown-linux-gnux32
- x86_64-unknown-linux-musl
# FIXME: It seems some items in `src/unix/mod.rs`
# aren't defined on redox actually.
# - x86_64-unknown-redox
env:
TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
run: ./ci/install-rust.sh
- name: Execute run-docker.sh
run: sh ./ci/run-docker.sh ${{ matrix.target }}
run: ./ci/run-docker.sh ${{ matrix.target }}

solaris:
name: Solaris
test_tier2_vm:
name: Test tier2 VM
needs: [test_tier1, style_check]
runs-on: ubuntu-latest
strategy:
fail-fast: true
Expand All @@ -207,40 +151,37 @@ jobs:
mem: 4096
copyback: false
prepare: |
set -x
source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install)
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ Solaris-version ~~~~"
uname -a
run: |
export PATH=$HOME/.rust_solaris/bin:$PATH
bash ./ci/run.sh ${{ matrix.target }}
./ci/run.sh ${{ matrix.target }}
check_cfg:
name: "Check #[cfg]s"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
TOOLCHAIN: nightly
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
run: ./ci/install-rust.sh
- name: Build with check-cfg
run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: success
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs:
- docker_linux_tier1
- docker_linux_tier2
- macos
- windows
- solaris
- style_check
- build_channels_linux
- build_channels_macos
- build_channels_windows
- test_tier1
- test_tier2
- test_tier2_vm
- verify_build
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ We have two automated tests running on
- `cd libc-test && cargo test`
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
2. Style checker
- [`sh ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)
- [`./ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)

## Breaking change policy

Expand Down
Empty file modified ci/android-install-ndk.sh
100644 → 100755
Empty file.
Empty file modified ci/android-install-sdk.sh
100644 → 100755
Empty file.
Empty file modified ci/android-sysimage.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions ci/docker/aarch64-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ COPY android* /android/
ENV ANDROID_ARCH=aarch64
ENV PATH=$PATH:/android/linux-x86_64/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools

RUN sh /android/android-install-ndk.sh
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN /android/android-install-ndk.sh
RUN /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/aarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu qemu-user

COPY install-musl.sh /
RUN sh /install-musl.sh aarch64
RUN /install-musl.sh aarch64

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/arm-linux-androideabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ COPY android* /android/
ENV ANDROID_ARCH=arm
ENV PATH=$PATH:/android/linux-x86_64/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools

RUN sh /android/android-install-ndk.sh
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN /android/android-install-ndk.sh
RUN /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/arm-unknown-linux-musleabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \
gcc-arm-linux-gnueabihf qemu-user

COPY install-musl.sh /
RUN sh /install-musl.sh arm
RUN /install-musl.sh arm

ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
CC_arm_unknown_linux_musleabihf=musl-gcc \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/asmjs-unknown-emscripten/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get install -y --no-install-recommends \
bzip2

COPY emscripten.sh /
RUN bash /emscripten.sh
RUN /emscripten.sh

ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/i686-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ COPY android* /android/
ENV ANDROID_ARCH=i686
ENV PATH=$PATH:/android/linux-x86_64/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools

RUN sh /android/android-install-ndk.sh
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN /android/android-install-ndk.sh
RUN /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/i686-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN sed -i -E 's/(archive|security)\.ubuntu\.com/old-releases.ubuntu.com/g' \
gcc-multilib make libc6-dev git curl ca-certificates libc6-i386

COPY install-musl.sh /
RUN sh /install-musl.sh i686
RUN /install-musl.sh i686

ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
CC_i686_unknown_linux_musl=musl-gcc \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/loongarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gcc git libc6-dev make qemu-user xz-utils

COPY install-musl-cross.sh /
RUN sh /install-musl-cross.sh loongarch64-unknown-linux-musl
RUN /install-musl-cross.sh loongarch64-unknown-linux-musl

ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/s390x-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cpio

COPY linux-s390x.sh /
RUN bash /linux-s390x.sh
RUN /linux-s390x.sh

COPY test-runner-linux /

Expand Down
Loading

0 comments on commit 979575b

Please sign in to comment.