theforeman / actions

Shared GitHub workflows for use in the Foreman project
3 stars 7 forks source link

Integrate GitHub annotations #31

Open ekohl opened 9 months ago

ekohl commented 9 months ago

Similar to how Jenkins can utilize JUnit XML to report failures, GitHub has annotations . The primary benefit is that you don't need to dig into the console output for failures, but rather report them as annotations in the changed files tab.

It depends on the tool/testing framework.

RuboCop

Version 1.2.0 introduced a GitHub formatter (via https://github.com/rubocop/rubocop/commit/e4a25e65744d6fb0f13a968d317dee59fb121761). This is enabled via rubocop --formatter github or via similar methods in Rakefile (where it can look at ENV['GITHUB_ACTIONS'] == 'true').

RSpec

There is rspec-github which documents its usage well.

Minitest

There is an open PR to integrate this into the tooling.

ekohl commented 9 months ago

For minitest I've created https://rubygems.org/gems/minitest_reporters_github and add it here: https://github.com/theforeman/foreman/pull/10010