ci: Run twister with forced color output

The GitHub Actions runner redirects the stdout and stderr console
outputs and, now that twister properly invokes the Colorama module
initialisation function, the color output is disabled when running the
twister in the CI.

This commit adds the `--force-color` option when invoking the twister
so that the ANSI color escape sequences are output even when the output
is redirected by the GitHub Actions runner (note that the web console
properly displays the color escape sequences).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2022-05-25 03:51:34 +09:00
parent 39956ec835
commit c534ae2947
3 changed files with 3 additions and 3 deletions

View file

@ -110,7 +110,7 @@ jobs:
if [ -s testplan.json ]; then
echo "::set-output name=report_needed::1";
# Full twister but with options based on changes
./scripts/twister --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
./scripts/twister --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2
else
# if nothing is run, skip reporting step
echo "::set-output name=report_needed::0";

View file

@ -86,7 +86,7 @@ jobs:
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
mkdir -p coverage/reports
./scripts/twister -N -v --filter runnable -p ${{ matrix.platform }} --coverage -T tests
./scripts/twister --force-color -N -v --filter runnable -p ${{ matrix.platform }} --coverage -T tests
- name: Generate Coverage Report
run: |

View file

@ -131,7 +131,7 @@ jobs:
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.14.2
CLANG_ROOT_DIR: /usr/lib/llvm-12
TWISTER_COMMON: ' --inline-logs -v -N -M --retry-failed 3 '
TWISTER_COMMON: ' --force-color --inline-logs -v -N -M --retry-failed 3 '
DAILY_OPTIONS: ' -M --build-only --all'
PR_OPTIONS: ' --clobber-output --integration'
PUSH_OPTIONS: ' --clobber-output -M'