From 344d71a1ee4d36280e6054786efc991c7fb2b73d Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Fri, 17 May 2024 12:10:38 -0400 Subject: [PATCH 1/2] workflow: force color support to be enabled See https://github.com/console-rs/indicatif/issues/631 and https://github.com/actions/runner/issues/241. Color support (or more precisely, whether the Actions runner advertises itself as a proper tty) seems flaky in GitHub. --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bb5b7bd2..d088066f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,6 +7,9 @@ on: schedule: - cron: "43 6 * * 5" +env: + CLICOLOR_FORCE: 1 + jobs: test: strategy: From 79e47d79f94e7e2bc1c4e9e8c9f15298a43f62a5 Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Fri, 17 May 2024 12:17:43 -0400 Subject: [PATCH 2/2] style: set_colors_enabled for good measure in wide_element_style --- src/style.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style.rs b/src/style.rs index 9211cadb..3fbf8879 100644 --- a/src/style.rs +++ b/src/style.rs @@ -779,7 +779,8 @@ mod tests { use super::*; use crate::state::{AtomicPosition, ProgressState}; - use console::colors_enabled; + + use console::set_colors_enabled; use std::sync::Mutex; #[test] @@ -865,7 +866,6 @@ mod tests { #[test] fn test_expand_template_flags() { - use console::set_colors_enabled; set_colors_enabled(true); const WIDTH: u16 = 80; @@ -926,7 +926,7 @@ mod tests { #[test] fn wide_element_style() { - println!("colors_enabled: {}", colors_enabled()); + set_colors_enabled(true); const CHARS: &str = "=>-"; const WIDTH: u16 = 8;