Skip to content

Commit

Permalink
ci: Trick GitHub Actions into displaying RSpec colors (#37)
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Nichols <[email protected]>
  • Loading branch information
technicalpickles authored Dec 13, 2022
1 parent b8b89c9 commit 61720e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"

RuboCop::RakeTask.new
RuboCop::RakeTask.new do |task|
task.options = ["--parallel"]
task.options << "--color" if ENV["CI"] == "true"
end

task default: %i[spec rubocop]
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@
config.expect_with :rspec do |c|
c.syntax = :expect
end

# ie for GitHub Actions
# see https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
if ENV["CI"] == "true"
# force tty to get output, which Actions does support
config.tty = true
end
end

0 comments on commit 61720e6

Please sign in to comment.