Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Vox Pupuli #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 41 additions & 11 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,41 @@
.github/SECURITY.md:
delete: true
.github/workflows/ci.yml:
beaker_fact_matrix: {}
excludes: []
pidfile_workaround: false
timeout_minutes: 40
additional_packages: ''
acceptance_tests: true
# PDK creates this
.github/workflows/puppet-lint.yml:
delete: true
.travis.yml:
delete: true
Jenkinsfile:
delete: true
Gemfile:
puppet_version: '>= 6.0'
puppet_version: '~> 7.24'
required:
':test':
- gem: voxpupuli-test
version: '~> 5.0'
version: '~> 6.0'
- gem: coveralls
- gem: simplecov-console
- gem: puppet_metadata
version: '~> 1.0'
version: '~> 3.0'
':development':
- gem: guard-rake
- gem: overcommit
version: '>= 0.39.1'
':system_tests':
- gem: voxpupuli-acceptance
version: '~> 1.0'
version: '~> 2.0'
':release':
- gem: github_changelog_generator
version: '>= 1.16.1'
ruby-version: '2.5'
ruby-operator: '>='
- gem: voxpupuli-release
version: '>= 1.2.0'
- gem: puppet-strings
version: '>= 2.2'
version: '~> 3.0'
- gem: faraday-retry
version: '~> 2.1'
Rakefile:
config.user: ccin2p3
puppet_strings_patterns: []
Expand All @@ -61,6 +62,8 @@ spec/default_facts.yml:
delete: true
spec/classes/coverage_spec.rb:
delete: true
spec/acceptance/nodesets/default.yml:
delete: true
spec/acceptance/nodesets/archlinux-2-x64.yml:
delete: true
spec/acceptance/nodesets/centos-511-x64.yml:
Expand Down Expand Up @@ -89,6 +92,16 @@ spec/acceptance/nodesets/fedora-26-x64.yml:
delete: true
spec/acceptance/nodesets/fedora-27-x64.yml:
delete: true
spec/acceptance/nodesets/debian-7-x64.yml:
delete: true
spec/acceptance/nodesets/debian-8-x64.yml:
delete: true
spec/acceptance/nodesets/sles-11-x64.yml:
delete: true
spec/acceptance/nodesets/sles-12-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-1604-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-server-1204-x64.yml:
delete: true
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml:
Expand All @@ -114,9 +127,12 @@ spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml:
spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml:
delete: true
spec/spec_helper.rb:
add_mocked_facts: true
mock_with: false
spec/spec_helper_acceptance.rb:
unmanaged: true
configure_beaker:
modules: ':metadata'
CONTRIBUTING.md:
delete: true
.yardopts:
Expand All @@ -130,5 +146,19 @@ appveyor.yml:
delete: true
pdk.yaml:
delete: true
.ruby-version:
delete: true
.tool-versions:
delete: true
CODE_OF_CONDUCT.md:
delete: true
.github/CODE_OF_CONDUCT.md:
delete: true
SECURITY.md:
delete: true
.github/SECURITY.md:
delete: true
Modulefile:
delete: true
...
# vim: syntax=yaml
120 changes: 17 additions & 103 deletions moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,107 +11,21 @@ concurrency:
cancel-in-progress: true

jobs:
setup_matrix:
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
timeout-minutes: <%= @configs['timeout_minutes'] %>
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_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: '3.0'
bundler-cache: true
- name: Run static validations
run: bundle exec rake validate lint check
- name: Run rake rubocop
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround <%= @configs['pidfile_workaround'] %>

unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: <%= @configs['timeout_minutes'] %>
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: 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
<%- if Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
<%- @configs['beaker_fact_matrix'].each do |option, values| -%>
<%= option %>:
<%- values.each do |value| -%>
- "<%= value %>"
<%- end -%>
<%- end -%>
<%- if @configs['excludes'].any? -%>
exclude:
<%- @configs['excludes'].each do |exclude| -%>
<%- exclude.each do |key, value| -%>
<%= key == exclude.first.first ? '-' : ' ' %> <%= key %>: "<%= value %>"
<%- end -%>
<%- end -%>
<%- end -%>
<%-
name = ['${{ matrix.puppet.name }}', '${{ matrix.setfile.name }}']
@configs['beaker_fact_matrix'].each_key do |option|
name << "#{option.tr('_', ' ').capitalize} ${{ matrix.#{option} }}"
end
-%>
name: <%= name.join(' - ') %>
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
<%- @configs['beaker_fact_matrix'].keys.each do |fact| -%>
BEAKER_FACTER_<%= fact.upcase %>: ${{ matrix.<%= fact %> }}
<%- end -%>
puppet:
name: Puppet
<%- if @configs['acceptance_tests'] && Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: '<%= @configs['pidfile_workaround'] %>'
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? -%>
with:
<%- end -%>
<%- end -%>
<%- unless @configs['additional_packages'].empty? -%>
additional_packages: '<%= @configs['additional_packages'] %>'
<%- end -%>
<%- if @configs.key?('rubocop') -%>
rubocop: <%= @configs['rubocop'] %>
<%- end -%>

tests:
needs:
- unit
<%- if Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
- acceptance
<%- end -%>
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
32 changes: 10 additions & 22 deletions moduleroot/.github/workflows/release.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@ on:
tags:
- '*'

env:
BUNDLE_WITHOUT: development:test:system_tests

jobs:
deploy:
name: 'deploy to forge'
runs-on: ubuntu-latest
if: github.repository_owner == '<%= @configs[:namespace] %>'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Build and Deploy
env:
# Configure secrets here:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
run: bundle exec rake module:push
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
with:
allowed_owner: '<%= @configs[:namespace] %>'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
username: ${{ secrets.PUPPET_FORGE_USERNAME }}
api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
36 changes: 18 additions & 18 deletions moduleroot/.gitignore.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

pkg/
Gemfile.lock
Gemfile.local
vendor/
.vendor/
spec/fixtures/manifests/
spec/fixtures/modules/
.vagrant/
.bundle/
.ruby-version
coverage/
log/
.idea/
.dependencies/
.librarian/
Puppetfile.lock
/pkg/
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/.vagrant/
/.bundle/
/.ruby-version
/coverage/
/log/
/.idea/
/.dependencies/
/.librarian/
/Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Guardfile
/.yardoc/
/Guardfile
<% if ! @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
Expand Down
2 changes: 1 addition & 1 deletion moduleroot/.msync.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '5.1.0'
modulesync_config_version: '6.0.0'
64 changes: 32 additions & 32 deletions moduleroot/.pmtignore.erb
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

docs/
pkg/
Gemfile
Gemfile.lock
Gemfile.local
vendor/
.vendor/
spec/
Rakefile
.vagrant/
.bundle/
.ruby-version
coverage/
log/
.idea/
.dependencies/
.github/
.librarian/
Puppetfile.lock
/docs/
/pkg/
/Gemfile
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/
/Rakefile
/.vagrant/
/.bundle/
/.ruby-version
/coverage/
/log/
/.idea/
/.dependencies/
/.github/
/.librarian/
/Puppetfile.lock
*.iml
.editorconfig
.fixtures.yml
.gitignore
.msync.yml
.overcommit.yml
.pmtignore
.rspec
.rspec_parallel
.rubocop.yml
.sync.yml
/.editorconfig
/.fixtures.yml
/.gitignore
/.msync.yml
/.overcommit.yml
/.pmtignore
/.rspec
/.rspec_parallel
/.rubocop.yml
/.sync.yml
.*.sw?
.yardoc/
.yardopts
Dockerfile
/.yardoc/
/.yardopts
/Dockerfile
<% if ! @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
Expand Down
Loading