From e34cdf9df349abd85c2118aa27cb14b765b3bf35 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 9 Mar 2022 14:29:11 +0100 Subject: [PATCH] Switch to gha-puppet for CI --- .github/workflows/ci.yml | 85 ++++++---------------------------------- Gemfile | 4 +- 2 files changed, 14 insertions(+), 75 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dc17d9..cd8418b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ +--- name: CI on: @@ -5,78 +6,16 @@ on: schedule: - cron: '4 4 * * *' -jobs: - setup_matrix: - if: github.event_name != 'schedule' || github.repository_owner == 'theforeman' - name: 'Setup Test Matrix' - runs-on: ubuntu-latest - outputs: - beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }} - puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }} - puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }} - env: - BUNDLE_WITHOUT: development:system_tests:release - steps: - - uses: actions/checkout@v2 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Run rake check - run: bundle exec rake check - - name: Run rake validate - run: bundle exec rake validate - - name: Run rake lint - run: bundle exec rake lint - - name: Setup Test Matrix - id: get_outputs - run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false - unit: - needs: setup_matrix - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} - env: - BUNDLE_WITHOUT: development:system_tests:release - PUPPET_VERSION: "${{ matrix.puppet }}.0" - name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) - steps: - - uses: actions/checkout@v2 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run tests - run: bundle exec rake parallel_spec +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true - acceptance: - needs: setup_matrix - runs-on: ubuntu-latest - env: - BUNDLE_WITHOUT: development:test:release - strategy: - fail-fast: false - matrix: - setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} - puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} - name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - steps: - - uses: actions/checkout@v2 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - bundler-cache: true - - name: Run tests - run: bundle exec rake beaker - env: - BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} - BEAKER_setfile: ${{ matrix.setfile.value }} - # In Puppet 7 the locale ends up being C.UTF-8 if it isn't passed. - # This locale doesn't exist in EL7 and won't be supported either. - LANG: en_US.UTF-8 +jobs: + puppet: + name: Puppet + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1 + with: + pidfile_workaround: 'false' + rubocop: false + cache-version: '1' diff --git a/Gemfile b/Gemfile index 52406de..763f2f0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' -gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test'] +gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test'] gem 'rake' gem 'kafo_module_lint', {"groups"=>["test"]} @@ -15,7 +15,7 @@ gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]} gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]} gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]} gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]} -gem 'puppet_metadata', '~> 0.3' +gem 'puppet_metadata', '~> 1.3' gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]} gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]} gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}