Skip to content

Commit 7084470

Browse files
authored
Merge pull request #4012 from tgross35/backport-ci-updates
[0.2] Backports
2 parents e009851 + 8285469 commit 7084470

File tree

2 files changed

+136
-154
lines changed

2 files changed

+136
-154
lines changed

.github/workflows/full_ci.yml

+124-154
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,107 @@ on:
66
branches:
77
- libc-0.2
88

9+
env:
10+
LIBC_CI: 1
11+
912
jobs:
10-
docker_linux_tier1:
11-
permissions:
12-
contents: read # to fetch code (actions/checkout)
13+
style_check:
14+
name: Style check
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup Rust toolchain
19+
run: sh ./ci/install-rust.sh
20+
- name: Check style
21+
run: sh ci/style.sh
1322

14-
name: Docker Linux Tier1
23+
build_channels_linux:
24+
name: Build Channels Linux
1525
runs-on: ubuntu-22.04
26+
env:
27+
OS: linux
1628
strategy:
1729
fail-fast: true
30+
max-parallel: 5
1831
matrix:
19-
target: [
20-
i686-unknown-linux-gnu,
21-
x86_64-unknown-linux-gnu,
22-
]
32+
toolchain:
33+
- stable
34+
- beta
35+
- nightly
36+
# FIXME: Disabled due to:
37+
# error: failed to parse registry's information for: serde
38+
# 1.13.0,
39+
- 1.19.0
40+
- 1.24.0
41+
- 1.25.0
42+
- 1.30.0
2343
steps:
2444
- uses: actions/checkout@v4
2545
- name: Setup Rust toolchain
26-
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
27-
- name: Execute run-docker.sh
28-
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
46+
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
47+
- name: Execute build.sh
48+
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
2949

30-
macos:
31-
permissions:
32-
contents: read # to fetch code (actions/checkout)
50+
build_channels_macos:
51+
name: Build Channels macOS
52+
needs: macos
53+
env:
54+
OS: macos
55+
strategy:
56+
fail-fast: true
57+
max-parallel: 4
58+
matrix:
59+
target:
60+
- { toolchain: stable, os: macos-13 }
61+
- { toolchain: beta, os: macos-13 }
62+
- { toolchain: nightly, os: macos-13 }
63+
runs-on: ${{ matrix.target.os }}
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: Setup Rust toolchain
67+
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
68+
- name: Execute build.sh
69+
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
70+
71+
build_channels_windows:
72+
name: Build Channels Windows
73+
runs-on: windows-2022
74+
env:
75+
OS: windows
76+
strategy:
77+
fail-fast: true
78+
matrix:
79+
toolchain:
80+
- 1.19.0
81+
- 1.24.0
82+
- 1.25.0
83+
- 1.30.0
84+
- stable
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Self-update rustup
88+
run: rustup self update
89+
shell: bash
90+
- name: Execute build.sh
91+
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
92+
shell: bash
3393

94+
macos:
3495
name: macOS
3596
runs-on: macos-13
3697
strategy:
3798
fail-fast: true
3899
matrix:
39-
target: [
40-
x86_64-apple-darwin,
41-
]
100+
target:
101+
- x86_64-apple-darwin
42102
steps:
43103
- uses: actions/checkout@v4
44104
- name: Setup Rust toolchain
45105
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
46106
- name: Execute run.sh
47-
run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
107+
run: sh ./ci/run.sh ${{ matrix.target }}
48108

49109
windows:
50-
permissions:
51-
contents: read # to fetch code (actions/checkout)
52-
53110
name: Windows
54111
runs-on: windows-2022
55112
env:
@@ -77,177 +134,90 @@ jobs:
77134
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
78135
shell: bash
79136
- name: Execute run.sh
80-
run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
137+
run: sh ./ci/run.sh ${{ matrix.target }}
81138
shell: bash
82139

83-
style_check:
84-
permissions:
85-
contents: read # to fetch code (actions/checkout)
86-
87-
name: Style check
140+
docker_linux_tier1:
141+
name: Docker Linux Tier1
88142
runs-on: ubuntu-22.04
143+
strategy:
144+
fail-fast: true
145+
matrix:
146+
target:
147+
- i686-unknown-linux-gnu
148+
- x86_64-unknown-linux-gnu
89149
steps:
90150
- uses: actions/checkout@v4
91151
- name: Setup Rust toolchain
92-
run: sh ./ci/install-rust.sh
93-
- name: Check style
94-
run: sh ci/style.sh
152+
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
153+
- name: Execute run-docker.sh
154+
run: sh ./ci/run-docker.sh ${{ matrix.target }}
95155

96156
docker_linux_tier2:
97-
permissions:
98-
contents: read # to fetch code (actions/checkout)
99-
100157
name: Docker Linux Tier2
101158
needs: [docker_linux_tier1, style_check]
102159
runs-on: ubuntu-22.04
103160
strategy:
104161
fail-fast: true
105162
max-parallel: 12
106163
matrix:
107-
target: [
108-
aarch64-linux-android,
109-
aarch64-unknown-linux-gnu,
110-
aarch64-unknown-linux-musl,
111-
arm-linux-androideabi,
112-
arm-unknown-linux-gnueabihf,
113-
arm-unknown-linux-musleabihf,
114-
i686-linux-android,
115-
i686-unknown-linux-musl,
116-
powerpc-unknown-linux-gnu,
117-
powerpc64-unknown-linux-gnu,
118-
powerpc64le-unknown-linux-gnu,
119-
s390x-unknown-linux-gnu,
120-
riscv64gc-unknown-linux-gnu,
121-
wasm32-wasip1,
122-
wasm32-wasip2,
123-
sparc64-unknown-linux-gnu,
124-
wasm32-unknown-emscripten,
125-
x86_64-linux-android,
164+
target:
165+
- aarch64-linux-android
166+
- aarch64-unknown-linux-gnu
167+
- aarch64-unknown-linux-musl
168+
- arm-linux-androideabi
169+
- arm-unknown-linux-gnueabihf
170+
- arm-unknown-linux-musleabihf
171+
- i686-linux-android
172+
- i686-unknown-linux-musl
173+
- loongarch64-unknown-linux-gnu
174+
- powerpc-unknown-linux-gnu
175+
- powerpc64-unknown-linux-gnu
176+
- powerpc64le-unknown-linux-gnu
177+
- s390x-unknown-linux-gnu
178+
- riscv64gc-unknown-linux-gnu
179+
- wasm32-wasip1
180+
- wasm32-wasip2
181+
- sparc64-unknown-linux-gnu
182+
- wasm32-unknown-emscripten
183+
- x86_64-linux-android
126184
# FIXME: Exec format error (os error 8)
127-
#x86_64-unknown-linux-gnux32,
128-
x86_64-unknown-linux-musl,
185+
# - x86_64-unknown-linux-gnux32
186+
- x86_64-unknown-linux-musl
129187
# FIXME: It seems some items in `src/unix/mod.rs`
130188
# aren't defined on redox actually.
131-
# x86_64-unknown-redox,
132-
]
189+
# - x86_64-unknown-redox
133190
steps:
134191
- uses: actions/checkout@v4
135192
- name: Setup Rust toolchain
136193
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
137194
- name: Execute run-docker.sh
138-
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
139-
140-
build_channels_linux:
141-
permissions:
142-
contents: read # to fetch code (actions/checkout)
143-
144-
name: Build Channels Linux
145-
needs: docker_linux_tier2
146-
runs-on: ubuntu-22.04
147-
env:
148-
OS: linux
149-
strategy:
150-
fail-fast: true
151-
max-parallel: 5
152-
matrix:
153-
toolchain: [
154-
stable,
155-
beta,
156-
nightly,
157-
# FIXME: Disabled due to:
158-
# error: failed to parse registry's information for: serde
159-
#1.13.0,
160-
1.19.0,
161-
1.24.0,
162-
1.25.0,
163-
1.30.0,
164-
]
165-
steps:
166-
- uses: actions/checkout@v4
167-
- name: Setup Rust toolchain
168-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
169-
- name: Execute build.sh
170-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
171-
172-
build_channels_macos:
173-
permissions:
174-
contents: read # to fetch code (actions/checkout)
175-
176-
name: Build Channels macOS
177-
needs: macos
178-
env:
179-
OS: macos
180-
strategy:
181-
fail-fast: true
182-
max-parallel: 4
183-
matrix:
184-
target:
185-
- { toolchain: stable, os: macos-13 }
186-
- { toolchain: beta, os: macos-13 }
187-
- { toolchain: nightly, os: macos-13 }
188-
runs-on: ${{ matrix.target.os }}
189-
steps:
190-
- uses: actions/checkout@v4
191-
- name: Setup Rust toolchain
192-
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
193-
- name: Execute build.sh
194-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
195-
196-
build_channels_windows:
197-
permissions:
198-
contents: read # to fetch code (actions/checkout)
199-
200-
name: Build Channels Windows
201-
runs-on: windows-2022
202-
env:
203-
OS: windows
204-
strategy:
205-
fail-fast: true
206-
matrix:
207-
toolchain: [
208-
1.19.0,
209-
1.24.0,
210-
1.25.0,
211-
1.30.0,
212-
stable,
213-
]
214-
steps:
215-
- uses: actions/checkout@v4
216-
- name: Self-update rustup
217-
run: rustup self update
218-
shell: bash
219-
- name: Execute build.sh
220-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
221-
shell: bash
195+
run: sh ./ci/run-docker.sh ${{ matrix.target }}
222196

223197
check_cfg:
224-
permissions:
225-
contents: read # to fetch code (actions/checkout)
226-
227198
name: "Check #[cfg]s"
228199
runs-on: ubuntu-22.04
229200
steps:
230201
- uses: actions/checkout@v4
231202
- name: Setup Rust toolchain
232203
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
233204
- name: Build with check-cfg
234-
run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
205+
run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
235206

236207
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
237208
# protection, rather than having to add each job separately.
238209
success:
239210
name: success
240211
runs-on: ubuntu-22.04
241-
needs: [
242-
docker_linux_tier1,
243-
docker_linux_tier2,
244-
macos,
245-
windows,
246-
style_check,
247-
build_channels_linux,
248-
build_channels_macos,
249-
build_channels_windows,
250-
]
212+
needs:
213+
- docker_linux_tier1
214+
- docker_linux_tier2
215+
- macos
216+
- windows
217+
- style_check
218+
- build_channels_linux
219+
- build_channels_macos
220+
- build_channels_windows
251221
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
252222
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
253223
# dependencies fails.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
gcc libc6-dev qemu-user ca-certificates \
5+
gcc-14-loongarch64-linux-gnu libc6-dev-loong64-cross \
6+
linux-headers-generic
7+
8+
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14 \
9+
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-loongarch64 -L /usr/loongarch64-linux-gnu" \
10+
CC_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-gcc-14 \
11+
CFLAGS_loongarch64_unknown_linux_gnu="-mabi=lp64d -fPIC" \
12+
PATH=$PATH:/rust/bin

0 commit comments

Comments
 (0)