From 74387d2c24a957df0128ccbfe52d7c23e1b58ad2 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 8 May 2024 18:01:29 +0200 Subject: [PATCH 1/2] [TMP] Remove packit to iterate faster --- .packit.yaml | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 .packit.yaml diff --git a/.packit.yaml b/.packit.yaml deleted file mode 100644 index bb4a0b25..00000000 --- a/.packit.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# See the documentation for more information: -# https://packit.dev/docs/configuration/ - -specfile_path: foreman-installer.spec - -# add or remove files that should be synced -files_to_sync: - - foreman-installer.spec - - .packit.yaml - -# name in upstream package repository or registry (e.g. in PyPI) -upstream_package_name: foreman-installer -# downstream (Fedora) RPM package name -downstream_package_name: foreman-installer - -upstream_tag_template: "{version}" - -actions: - post-upstream-clone: - - "wget https://raw.githubusercontent.com/theforeman/foreman-packaging/rpm/develop/packages/foreman/foreman-installer/foreman-installer.spec -O foreman-installer.spec" - get-current-version: - - "sed 's/-develop//' VERSION" - create-archive: - - bundle config set --local path vendor/bundle - - bundle config set --local without development:test - - bundle install - - bundle exec rake pkg:generate_source - - bash -c "ls -1t pkg/*.tar.bz2 | head -n 1" - -jobs: - - job: copr_build - trigger: pull_request - targets: - rhel-8: - additional_modules: "foreman:el8" - additional_repos: - - https://yum.theforeman.org/releases/nightly/el8/x86_64/ - - https://yum.puppet.com/puppet7/el/8/x86_64/ - rhel-9: - additional_repos: - - https://yum.theforeman.org/releases/nightly/el9/x86_64/ - - https://yum.puppet.com/puppet7/el/9/x86_64/ - module_hotfixes: true - -srpm_build_deps: - - wget - - make - - gcc - - ruby - - ruby-devel - - rubygem-bundler From 8ee2f91ec940d86e6f6c5086e2df979643fab3eb Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 8 May 2024 17:57:38 +0200 Subject: [PATCH 2/2] Use system Puppet in CI This uses the official Puppet AIO packages, which is also what we use in production. This makes the tests more realistic. --- .github/workflows/test.yml | 17 ++++++++++++----- Gemfile | 12 +++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8acbfe40..6129b393 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,17 +26,23 @@ jobs: matrix: include: - ruby: '2.7' - puppet: '7.0' + puppet: '7' - ruby: '3.0' - puppet: '7.0' + puppet: '7' - ruby: '3.2' - puppet: '8.0' + puppet: '8' env: - PUPPET_VERSION: ${{ matrix.puppet }} + BUNDLE_WITHOUT: puppet:rubocop steps: - uses: actions/checkout@v4 + - name: Set up Puppet repositories + run: | + . /etc/os-release + wget "https://apt.puppet.com/puppet${{ matrix.puppet }}-release-${VERSION_CODENAME}.deb" + sudo apt install "${PWD}/puppet${{ matrix.puppet }}-release-${VERSION_CODENAME}.deb" + sudo apt update - name: Install system dependencies - run: sudo apt-get install -y --no-install-recommends asciidoc + run: sudo apt-get install -y --no-install-recommends asciidoc puppet-agent - name: Setup ruby uses: ruby/setup-ruby@v1 with: @@ -51,6 +57,7 @@ jobs: run: bundle exec rake spec - name: Test installer configuration run: | + . /etc/profile.d/puppet-agent.sh bundle exec rake install PREFIX=./local --trace bundle exec rake installation_tests PREFIX=./local --trace diff --git a/Gemfile b/Gemfile index ce09ce51..4d453e16 100644 --- a/Gemfile +++ b/Gemfile @@ -6,8 +6,11 @@ gem 'rdoc', '< 6.4' gem 'kafo', '>= 7.3', '< 8' gem 'librarian-puppet', '>= 3.0' -gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 7.0' -gem 'facter', '>= 3.0', '!= 4.0.52' + +group :puppet do + gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 7.0' + gem 'facter', '>= 3.0', '!= 4.0.52' +end gem 'puppet-strings' gem 'rake' @@ -16,10 +19,13 @@ gem 'racc' if RUBY_VERSION >= '3.3' gem 'semverse', groups: [:development, :test] +group :rubocop do + gem 'rubocop', '~> 0.80.0' +end + group :test do gem 'rspec' gem 'rspec_junit_formatter' - gem 'rubocop', '~> 0.80.0' end group :development do