-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Create GitHub groups in log outputs for FPGA tests
The log are quite long and GitHub provides a feature where the output group can split lines into groups. This is achieved by using the --run_under command of bazel test. This allows to run a script that then invokes the test runner. This only thing this script does is print the grouping commands. Signed-off-by: Amaury Pouly <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
sh_binary( | ||
name = "run_test", | ||
srcs = ["run_test.sh"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Copyright lowRISC contributors (OpenTitan project). | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Print a special GitHub command to create a group in the log's output: | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#grouping-log-lines | ||
# | ||
# Test variables are documented here: | ||
# https://bazel.build/reference/test-encyclopedia | ||
if [ -z "$TEST_RUN_NUMBER" ]; then | ||
RUN_NR="" | ||
else | ||
RUN_NR="(Run $TEST_RUN_NUMBER)" | ||
fi | ||
echo "::group::$TEST_TARGET $RUN_NR" | ||
# NOTE Even if the command fails, we still want to continue to print | ||
# the endgroup command. | ||
exec $@ | ||
echo "::endgroup::" |