Skip to content

Commit 142d7cb

Browse files
committed
Adjust coverage CI job to download kernel artifact concurrently
Adjust the coverage CI job to download the kernel artifact concurrently with the compilation of tests. This job is on the critical path of CI, so making it as fast as possible minimizes overall CI runtime. Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent 0fd4981 commit 142d7cb

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,34 +219,40 @@ jobs:
219219
echo "export PYTHON=${PYTHON}" >> env.sh
220220
source env.sh
221221
222-
cargo test --no-run --workspace --all-targets --features=zstd,nightly,blazesym-dev/generate-large-test-files 2>&1 | tee /tmp/cargo-build.log
223-
tests=$(IFS='' grep Executable /tmp/cargo-build.log |
224-
awk '{print $NF}' |
225-
sed 's@[()]@@g' |
226-
sed 's@.*@\0 --include-ignored@'
227-
)
228222
# Yes, there appears to be no way to just retrieve the
229223
# uploaded artifact. One can't use actions/download-artifact
230224
# and provide any of the outputs of actions/upload-artifact.
231225
# Neither does it seem possible to just download the thing
232226
# directly, because contents are unconditionally zipped. Good.
233227
# Lord.
234-
curl --location \
228+
229+
# Download artifact in parallel with test compilation. The unzip
230+
# will produce the kernel bzImage and vmlinux.
231+
(curl --location \
235232
--fail-with-body \
236233
--header "Accept: application/vnd.github+json" \
237234
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
238235
--header "X-GitHub-Api-Version: 2022-11-28" \
239236
--output artifact.zip \
240-
"${ARTIFACT_URL}"
241-
# This unzip will produce the kernel bzImage and vmlinux.
242-
unzip artifact.zip
243-
# Put vmlinux file into a location amenable to auto-discovery.
244-
sudo mv vmlinux /boot/vmlinux-6.11.0
237+
"${ARTIFACT_URL}" && unzip artifact.zip) &
238+
artifact_pid=$!
239+
240+
cargo test --no-run --workspace --all-targets --features=zstd,nightly,blazesym-dev/generate-large-test-files 2>&1 | tee /tmp/cargo-build.log
241+
tests=$(IFS='' grep Executable /tmp/cargo-build.log |
242+
awk '{print $NF}' |
243+
sed 's@[()]@@g' |
244+
sed 's@.*@\0 --include-ignored@'
245+
)
246+
247+
wait $artifact_pid
245248
246249
cat <<EOF > main.sh
247250
#!/bin/sh
248-
set -e
251+
set -e -u
249252
. ./env.sh
253+
mount -t tmpfs tmpfs /boot
254+
# Put vmlinux file into a location amenable to auto-discovery.
255+
mv vmlinux /boot/vmlinux-6.11.0
250256
$tests
251257
cargo llvm-cov report --ignore-filename-regex=cli/src/ --lcov --output-path lcov.info
252258
EOF

0 commit comments

Comments
 (0)