Skip to content

Commit

Permalink
Use gha-puppet again
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Oct 10, 2023
1 parent 04cd413 commit 2972afb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 81 deletions.
92 changes: 12 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,19 @@
---
name: CI

on:
pull_request:

jobs:
setup_matrix:
name: Static validations
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
PUPPET_GEM_VERSION: "~> 7.0"
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Run static validations
run: bundle exec rake validate lint check
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --domain example.com --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_GEM_VERSION: "~> ${{ matrix.puppet }}.0"
name: ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v4
- 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

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)}}
pulpcore_version:
- '3.28'
- '3.22'
- '3.21'
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - Pulp ${{ matrix.pulpcore_version }}
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_SETFILE: ${{ matrix.setfile.value }}
BEAKER_FACTER_PULPCORE_VERSION: ${{ matrix.pulpcore_version }}
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true

tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
jobs:
puppet:
name: Puppet
uses: voxpupuli/ekohl/.github/workflows/beaker.yml@set-in-env-var
with:
pidfile_workaround: 'false'
rubocop: false
cache-version: '1'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 1.0', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 7.0', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 3.3'
gem 'puppet_metadata', github: 'ekohl/puppet_metadata', branch: 'beaker-facts'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 2.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}
Expand Down

0 comments on commit 2972afb

Please sign in to comment.