Skip to content

Commit e00ed36

Browse files
ekohlehelms
authored andcommitted
Switch to gha-puppet for CI
1 parent 92256a7 commit e00ed36

File tree

2 files changed

+14
-72
lines changed

2 files changed

+14
-72
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,21 @@
1+
---
12
name: CI
23

34
on:
45
pull_request:
56
schedule:
67
- cron: '4 4 * * *'
78

8-
jobs:
9-
setup_matrix:
10-
if: github.event_name != 'schedule' || github.repository_owner == 'theforeman'
11-
name: 'Setup Test Matrix'
12-
runs-on: ubuntu-latest
13-
outputs:
14-
beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }}
15-
puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }}
16-
puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }}
17-
env:
18-
BUNDLE_WITHOUT: development:system_tests:release
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Setup ruby
22-
uses: ruby/setup-ruby@v1
23-
with:
24-
ruby-version: '2.7'
25-
bundler-cache: true
26-
- name: Run rake check
27-
run: bundle exec rake check
28-
- name: Run rake validate
29-
run: bundle exec rake validate
30-
- name: Run rake lint
31-
run: bundle exec rake lint
32-
- name: Setup Test Matrix
33-
id: get_outputs
34-
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround true
359

36-
unit:
37-
needs: setup_matrix
38-
runs-on: ubuntu-latest
39-
strategy:
40-
fail-fast: false
41-
matrix:
42-
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
43-
env:
44-
BUNDLE_WITHOUT: development:system_tests:release
45-
PUPPET_VERSION: "${{ matrix.puppet }}.0"
46-
name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
47-
steps:
48-
- uses: actions/checkout@v2
49-
- name: Setup ruby
50-
uses: ruby/setup-ruby@v1
51-
with:
52-
ruby-version: ${{ matrix.ruby }}
53-
bundler-cache: true
54-
- name: Run tests
55-
run: bundle exec rake parallel_spec
10+
concurrency:
11+
group: ${{ github.ref_name }}
12+
cancel-in-progress: true
5613

57-
acceptance:
58-
needs: setup_matrix
59-
runs-on: ubuntu-latest
60-
env:
61-
BUNDLE_WITHOUT: development:test:release
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
66-
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
67-
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
68-
steps:
69-
- uses: actions/checkout@v2
70-
- name: Setup ruby
71-
uses: ruby/setup-ruby@v1
72-
with:
73-
ruby-version: '2.7'
74-
bundler-cache: true
75-
- name: Run tests
76-
run: bundle exec rake beaker
77-
env:
78-
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
79-
BEAKER_setfile: ${{ matrix.setfile.value }}
14+
jobs:
15+
puppet:
16+
name: Puppet
17+
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
18+
with:
19+
pidfile_workaround: 'true'
20+
rubocop: false
21+
cache-version: '1'

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
source 'https://rubygems.org'
55

6-
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test']
6+
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
77
gem 'rake'
88

99
gem 'kafo_module_lint', {"groups"=>["test"]}
@@ -15,7 +15,7 @@ gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
1515
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
1616
gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]}
1717
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
18-
gem 'puppet_metadata', '~> 0.3'
18+
gem 'puppet_metadata', '~> 1.3'
1919
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
2020
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
2121
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}

0 commit comments

Comments
 (0)