Skip to content

Commit 766444e

Browse files
committed
CI: use free runners for i686-gnu jobs
1 parent caa8172 commit 766444e

File tree

4 files changed

+73
-26
lines changed

4 files changed

+73
-26
lines changed

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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 7 deletions
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

Lines changed: 22 additions & 13 deletions
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 SCRIPT is defined,
118+
# set the build argument SCRIPT_ARG to SCRIPT.
119+
# In this way, we run the SCRIPT defined in CI,
120+
# instead of the one defined in the Dockerfile.
121+
if [ -n "${SCRIPT+x}" ]; then
122+
build_args+=("--build-arg" "SCRIPT_ARG=${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

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,54 @@ auto:
212212
- image: dist-x86_64-netbsd
213213
<<: *job-linux-4c
214214

215-
- image: i686-gnu
216-
<<: *job-linux-8c
215+
# The i686-gnu job is split into multiple jobs to run tests in parallel.
216+
# i686-gnu-1 skips tests that run in i686-gnu-2.
217+
- image: i686-gnu-1
218+
env:
219+
IMAGE: i686-gnu
220+
SCRIPT: >-
221+
python3 ../x.py --stage 2 test
222+
--skip compiler
223+
--skip src
224+
<<: *job-linux-4c
217225

218-
- image: i686-gnu-nopt
219-
<<: *job-linux-8c
226+
# Skip tests that run in i686-gnu-1
227+
- image: i686-gnu-2
228+
env:
229+
IMAGE: i686-gnu
230+
SCRIPT: >-
231+
python3 ../x.py --stage 2 test
232+
--skip tests
233+
--skip coverage-map
234+
--skip coverage-run
235+
--skip library
236+
--skip tidyselftest
237+
<<: *job-linux-4c
238+
239+
# The i686-gnu-nopt job is split into multiple jobs to run tests in parallel.
240+
# i686-gnu-nopt-1 skips tests that run in i686-gnu-nopt-2
241+
- image: i686-gnu-nopt-1
242+
env:
243+
IMAGE: i686-gnu-nopt
244+
SCRIPT: >-
245+
python3 ../x.py --stage 2 test
246+
--skip compiler
247+
--skip src
248+
<<: *job-linux-4c
249+
250+
# Skip tests that run in i686-gnu-nopt-1
251+
- image: i686-gnu-nopt-2
252+
env:
253+
IMAGE: i686-gnu-nopt
254+
SCRIPT: >-
255+
python3 ../x.py test --stage 0 --config /config/nopt-std-config.toml library/std &&
256+
python3 ../x.py --stage 2 test
257+
--skip tests
258+
--skip coverage-map
259+
--skip coverage-run
260+
--skip library
261+
--skip tidyselftest
262+
<<: *job-linux-4c
220263

221264
- image: mingw-check
222265
<<: *job-linux-4c

0 commit comments

Comments
 (0)