prettify our CI logs

This commit is contained in:
Ralf Jung 2022-11-26 14:03:41 +01:00
parent 4d3e565004
commit 56a1d07cb7

View File

@ -1,6 +1,17 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
set -x
function begingroup {
echo "::group::$1"
set -x
}
function endgroup {
set +x
echo "::endgroup"
}
begingroup "Building Miri"
# Determine configuration for installed build # Determine configuration for installed build
echo "Installing release version of Miri" echo "Installing release version of Miri"
@ -14,14 +25,15 @@ export CARGO_EXTRA_FLAGS="--locked"
./miri check --no-default-features # make sure this can be built ./miri check --no-default-features # make sure this can be built
./miri check --all-features # and this, too ./miri check --all-features # and this, too
./miri build --all-targets # the build that all the `./miri test` below will use ./miri build --all-targets # the build that all the `./miri test` below will use
echo
endgroup
# Test # Test
function run_tests { function run_tests {
if [ -n "${MIRI_TEST_TARGET+exists}" ]; then if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
echo "Testing foreign architecture $MIRI_TEST_TARGET" begingroup "Testing foreign architecture $MIRI_TEST_TARGET"
else else
echo "Testing host architecture" begingroup "Testing host architecture"
fi fi
## ui test suite ## ui test suite
@ -52,7 +64,6 @@ function run_tests {
echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml
# Run the actual test # Run the actual test
${PYTHON} test-cargo-miri/run-test.py ${PYTHON} test-cargo-miri/run-test.py
echo
# Clean up # Clean up
unset RUSTC MIRI unset RUSTC MIRI
rm -rf .cargo rm -rf .cargo
@ -63,13 +74,15 @@ function run_tests {
cargo miri run --manifest-path bench-cargo-miri/$BENCH/Cargo.toml cargo miri run --manifest-path bench-cargo-miri/$BENCH/Cargo.toml
done done
fi fi
endgroup
} }
function run_tests_minimal { function run_tests_minimal {
if [ -n "${MIRI_TEST_TARGET+exists}" ]; then if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
echo "Testing MINIMAL foreign architecture $MIRI_TEST_TARGET: only testing $@" begingroup "Testing MINIMAL foreign architecture $MIRI_TEST_TARGET: only testing $@"
else else
echo "Testing MINIMAL host architecture: only testing $@" begingroup "Testing MINIMAL host architecture: only testing $@"
fi fi
./miri test -- "$@" ./miri test -- "$@"
@ -77,6 +90,8 @@ function run_tests_minimal {
# Ensure that a small smoke test of cargo-miri works. # Ensure that a small smoke test of cargo-miri works.
# Note: This doesn't work on windows because of TLS. # Note: This doesn't work on windows because of TLS.
cargo miri run --manifest-path test-cargo-miri/no-std-smoke/Cargo.toml cargo miri run --manifest-path test-cargo-miri/no-std-smoke/Cargo.toml
endgroup
} }
# host # host