From afb50064f6050b99f0632f31847619cbe4b43253 Mon Sep 17 00:00:00 2001 From: Oleh Fedorenko Date: Wed, 27 Nov 2024 16:13:50 +0000 Subject: [PATCH] Add rubocop check for CI --- .github/workflows/ruby_tests.yml | 5 +++++ Gemfile | 2 +- Rakefile | 7 +++++++ foreman_openscap.gemspec | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby_tests.yml b/.github/workflows/ruby_tests.yml index 72d922752..601ff4412 100644 --- a/.github/workflows/ruby_tests.yml +++ b/.github/workflows/ruby_tests.yml @@ -9,8 +9,13 @@ on: pull_request: jobs: + rubocop: + name: Rubocop + uses: theforeman/actions/.github/workflows/rubocop.yml@v0 + test: name: Ruby + needs: rubocop uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0 with: plugin: foreman_openscap diff --git a/Gemfile b/Gemfile index da59d0358..d08008dab 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "http://rubygems.org" -gem 'theforeman-rubocop', '~> 0.1.0.pre', groups: %i[development rubocop] +gem 'theforeman-rubocop', '~> 0.1.1', groups: %i[development rubocop] gemspec diff --git a/Rakefile b/Rakefile index 6006cf3fc..ba84d04fc 100755 --- a/Rakefile +++ b/Rakefile @@ -34,3 +34,10 @@ Rake::TestTask.new(:test) do |t| end task :default => :test + +begin + require 'rubocop/rake_task' + RuboCop::RakeTask.new +rescue => _ + puts 'Rubocop not loaded.' +end diff --git a/foreman_openscap.gemspec b/foreman_openscap.gemspec index 3f8a90c77..314da1303 100644 --- a/foreman_openscap.gemspec +++ b/foreman_openscap.gemspec @@ -14,4 +14,5 @@ Gem::Specification.new do |s| s.test_files = Dir["test/**/*"] s.add_development_dependency "rake" + s.add_development_dependency "rdoc" end