Skip to content
/ rust Public
forked from rust-lang/rust
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4cc8473

Browse files
authoredDec 5, 2024
Rollup merge of rust-lang#133256 - MarcoIeni:use-linux-free-runners, r=Kobzol
CI: use free runners for i686-gnu jobs try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: i686-gnu-nopt-1 try-job: i686-gnu-nopt-2
2 parents 0e98766 + b81391e commit 4cc8473

File tree

4 files changed

+77
-26
lines changed

4 files changed

+77
-26
lines changed
 

‎src/ci/docker/host-x86_64/i686-gnu-nopt/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ RUN echo "[rust]" > /config/nopt-std-config.toml
2727
RUN echo "optimize = false" >> /config/nopt-std-config.toml
2828

2929
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
30-
ENV SCRIPT python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std \
31-
&& python3 ../x.py --stage 2 test
30+
ARG SCRIPT_ARG
31+
ENV SCRIPT=${SCRIPT_ARG}

‎src/ci/docker/host-x86_64/i686-gnu/Dockerfile

+2-7
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,5 @@ COPY scripts/sccache.sh /scripts/
2424
RUN sh /scripts/sccache.sh
2525

2626
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
27-
# Skip some tests that are unlikely to be platform specific, to speed up
28-
# this slow job.
29-
ENV SCRIPT python3 ../x.py --stage 2 test \
30-
--skip src/bootstrap \
31-
--skip tests/rustdoc-js \
32-
--skip src/tools/error_index_generator \
33-
--skip src/tools/linkchecker
27+
ARG SCRIPT_ARG
28+
ENV SCRIPT=${SCRIPT_ARG}

‎src/ci/docker/run.sh

+22-13
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
105105
# It seems that it cannot be the same as $IMAGE_TAG, otherwise it overwrites the cache
106106
CACHE_IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci-cache:${cksum}
107107

108+
# Docker build arguments.
109+
build_args=(
110+
"build"
111+
"--rm"
112+
"-t" "rust-ci"
113+
"-f" "$dockerfile"
114+
"$context"
115+
)
116+
117+
# If the environment variable DOCKER_SCRIPT is defined,
118+
# set the build argument SCRIPT_ARG to DOCKER_SCRIPT.
119+
# In this way, we run the script defined in CI,
120+
# instead of the one defined in the Dockerfile.
121+
if [ -n "${DOCKER_SCRIPT+x}" ]; then
122+
build_args+=("--build-arg" "SCRIPT_ARG=${DOCKER_SCRIPT}")
123+
fi
124+
108125
# On non-CI jobs, we try to download a pre-built image from the rust-lang-ci
109126
# ghcr.io registry. If it is not possible, we fall back to building the image
110127
# locally.
@@ -115,7 +132,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
115132
docker tag "${IMAGE_TAG}" rust-ci
116133
else
117134
echo "Building local Docker image"
118-
retry docker build --rm -t rust-ci -f "$dockerfile" "$context"
135+
retry docker "${build_args[@]}"
119136
fi
120137
# On PR CI jobs, we don't have permissions to write to the registry cache,
121138
# but we can still read from it.
@@ -127,13 +144,9 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
127144
# Build the image using registry caching backend
128145
retry docker \
129146
buildx \
130-
build \
131-
--rm \
132-
-t rust-ci \
133-
-f "$dockerfile" \
147+
"${build_args[@]}" \
134148
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
135-
--output=type=docker \
136-
"$context"
149+
--output=type=docker
137150
# On auto/try builds, we can also write to the cache.
138151
else
139152
# Log into the Docker registry, so that we can read/write cache and the final image
@@ -147,14 +160,10 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
147160
# Build the image using registry caching backend
148161
retry docker \
149162
buildx \
150-
build \
151-
--rm \
152-
-t rust-ci \
153-
-f "$dockerfile" \
163+
"${build_args[@]}" \
154164
--cache-from type=registry,ref=${CACHE_IMAGE_TAG} \
155165
--cache-to type=registry,ref=${CACHE_IMAGE_TAG},compression=zstd \
156-
--output=type=docker \
157-
"$context"
166+
--output=type=docker
158167

159168
# Print images for debugging purposes
160169
docker images

‎src/ci/github-actions/jobs.yml

+51-4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ envs:
5858
NO_DEBUG_ASSERTIONS: 1
5959
NO_OVERFLOW_CHECKS: 1
6060

61+
# Different set of tests to run tests in parallel in multiple jobs.
62+
stage_2_test_set1: &stage_2_test_set1
63+
DOCKER_SCRIPT: >-
64+
python3 ../x.py --stage 2 test
65+
--skip compiler
66+
--skip src
67+
68+
stage_2_test_set2: &stage_2_test_set2
69+
DOCKER_SCRIPT: >-
70+
python3 ../x.py --stage 2 test
71+
--skip tests
72+
--skip coverage-map
73+
--skip coverage-run
74+
--skip library
75+
--skip tidyselftest
76+
6177
production:
6278
&production
6379
DEPLOY_BUCKET: rust-lang-ci2
@@ -212,11 +228,42 @@ auto:
212228
- image: dist-x86_64-netbsd
213229
<<: *job-linux-4c
214230

215-
- image: i686-gnu
216-
<<: *job-linux-8c
231+
# The i686-gnu job is split into multiple jobs to run tests in parallel.
232+
# i686-gnu-1 skips tests that run in i686-gnu-2.
233+
- image: i686-gnu-1
234+
env:
235+
IMAGE: i686-gnu
236+
<<: *stage_2_test_set1
237+
<<: *job-linux-4c
217238

218-
- image: i686-gnu-nopt
219-
<<: *job-linux-8c
239+
# Skip tests that run in i686-gnu-1
240+
- image: i686-gnu-2
241+
env:
242+
IMAGE: i686-gnu
243+
<<: *stage_2_test_set2
244+
<<: *job-linux-4c
245+
246+
# The i686-gnu-nopt job is split into multiple jobs to run tests in parallel.
247+
# i686-gnu-nopt-1 skips tests that run in i686-gnu-nopt-2
248+
- image: i686-gnu-nopt-1
249+
env:
250+
IMAGE: i686-gnu-nopt
251+
<<: *stage_2_test_set1
252+
<<: *job-linux-4c
253+
254+
# Skip tests that run in i686-gnu-nopt-1
255+
- image: i686-gnu-nopt-2
256+
env:
257+
IMAGE: i686-gnu-nopt
258+
DOCKER_SCRIPT: >-
259+
python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std &&
260+
python3 ../x.py --stage 2 test
261+
--skip tests
262+
--skip coverage-map
263+
--skip coverage-run
264+
--skip library
265+
--skip tidyselftest
266+
<<: *job-linux-4c
220267

221268
- image: mingw-check
222269
<<: *job-linux-4c

0 commit comments

Comments
 (0)
Failed to load comments.