From f1d41e26d5fefb94c055867d6e9d97a52463130a Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 22 Jan 2024 14:51:24 -0500 Subject: [PATCH] Use foreman GH action workflow --- .github/workflows/unit-tests.yml | 37 ++++++++++++-------------------- Gemfile | 15 ------------- hammer_cli_katello.gemspec | 9 ++++---- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 190ead6bb..fcc38c87b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,27 +1,18 @@ -name: Run unit tests +name: CI -on: - - push - - pull_request +on: pull_request -jobs: - test: +concurrency: + group: ${{ github.ref_name }}-${{ github.workflow }} + cancel-in-progress: true - runs-on: ubuntu-latest - strategy: - matrix: - ruby: ["2.7"] +jobs: + rubocop: + name: Rubocop + uses: theforeman/actions/.github/workflows/rubocop.yml@v0 - steps: - - uses: actions/checkout@v2 - - name: Add hammer-cli-foreman to local gem file - run: echo "gem 'hammer_cli_foreman', :git => 'https://github.com/theforeman/hammer-cli-foreman.git'" > Gemfile.local - - name: Add hammer-cli to local gem file - run: echo "gem 'hammer_cli', :git => 'https://github.com/theforeman/hammer-cli.git'" >> Gemfile.local - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run tests - run: bundle exec rake + test: + name: Tests + uses: theforeman/actions/.github/workflows/test-gem.yml@v0 + with: + command: bundle exec rake test diff --git a/Gemfile b/Gemfile index 144b85892..d18869dcb 100644 --- a/Gemfile +++ b/Gemfile @@ -2,21 +2,6 @@ source "https://rubygems.org" gemspec -# for generating i18n files, gettext > 3.0 dropped ruby 1.8 support -gem 'gettext', '>= 3.1.3', '< 4.0.0' - -group :test do - gem 'rake', '~> 10.1.0' - gem 'thor' - gem 'minitest', '4.7.4' - gem 'minitest-spec-context' - gem 'mocha' - gem 'coveralls', '0.8.23', require: false - gem 'ci_reporter', '>= 1.6.3', "< 2.0.0", :require => false - gem 'rubocop', '0.42' - gem 'rubocop-checkstyle_formatter' -end - # load local gemfile ['Gemfile.local.rb', 'Gemfile.local'].map do |file_name| local_gemfile = File.join(File.dirname(__FILE__), file_name) diff --git a/hammer_cli_katello.gemspec b/hammer_cli_katello.gemspec index 6ea3e0d98..d39eb2eeb 100644 --- a/hammer_cli_katello.gemspec +++ b/hammer_cli_katello.gemspec @@ -63,9 +63,11 @@ Gem::Specification.new do |gem| gem.name = 'hammer_cli_katello' gem.require_paths = ['lib'] gem.version = HammerCLIKatello.version + gem.required_ruby_version = '>= 2.7' gem.add_dependency 'hammer_cli_foreman' gem.add_dependency 'hammer_cli_foreman_tasks' + gem.add_dependency 'gettext', '>= 3.1.3', '< 4.0.0' gem.add_development_dependency 'rake' gem.add_development_dependency 'thor' @@ -73,8 +75,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'minitest-spec-context' gem.add_development_dependency 'simplecov' gem.add_development_dependency 'mocha' - gem.add_development_dependency 'ci_reporter' - - gem.add_development_dependency "rubocop", "0.42" - gem.add_development_dependency "rubocop-checkstyle_formatter" + gem.add_development_dependency 'ci_reporter', '>= 1.6.3', "< 2.0.0" + gem.add_development_dependency 'rubocop', '0.42' + gem.add_development_dependency 'rubocop-checkstyle_formatter' end