Skip to content

Commit b3e4402

Browse files
committed
Auto merge of #2695 - RalfJung:ci-pretty, r=RalfJung
prettify our CI logs
2 parents 4d3e565 + 56a1d07 commit b3e4402

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/tools/miri/ci.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/bin/bash
22
set -euo pipefail
3-
set -x
3+
4+
function begingroup {
5+
echo "::group::$1"
6+
set -x
7+
}
8+
9+
function endgroup {
10+
set +x
11+
echo "::endgroup"
12+
}
13+
14+
begingroup "Building Miri"
415

516
# Determine configuration for installed build
617
echo "Installing release version of Miri"
@@ -14,14 +25,15 @@ export CARGO_EXTRA_FLAGS="--locked"
1425
./miri check --no-default-features # make sure this can be built
1526
./miri check --all-features # and this, too
1627
./miri build --all-targets # the build that all the `./miri test` below will use
17-
echo
28+
29+
endgroup
1830

1931
# Test
2032
function run_tests {
2133
if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
22-
echo "Testing foreign architecture $MIRI_TEST_TARGET"
34+
begingroup "Testing foreign architecture $MIRI_TEST_TARGET"
2335
else
24-
echo "Testing host architecture"
36+
begingroup "Testing host architecture"
2537
fi
2638

2739
## ui test suite
@@ -52,7 +64,6 @@ function run_tests {
5264
echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml
5365
# Run the actual test
5466
${PYTHON} test-cargo-miri/run-test.py
55-
echo
5667
# Clean up
5768
unset RUSTC MIRI
5869
rm -rf .cargo
@@ -63,20 +74,24 @@ function run_tests {
6374
cargo miri run --manifest-path bench-cargo-miri/$BENCH/Cargo.toml
6475
done
6576
fi
77+
78+
endgroup
6679
}
6780

6881
function run_tests_minimal {
6982
if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
70-
echo "Testing MINIMAL foreign architecture $MIRI_TEST_TARGET: only testing $@"
83+
begingroup "Testing MINIMAL foreign architecture $MIRI_TEST_TARGET: only testing $@"
7184
else
72-
echo "Testing MINIMAL host architecture: only testing $@"
85+
begingroup "Testing MINIMAL host architecture: only testing $@"
7386
fi
7487

7588
./miri test -- "$@"
7689

7790
# Ensure that a small smoke test of cargo-miri works.
7891
# Note: This doesn't work on windows because of TLS.
7992
cargo miri run --manifest-path test-cargo-miri/no-std-smoke/Cargo.toml
93+
94+
endgroup
8095
}
8196

8297
# host

0 commit comments

Comments
 (0)