Skip to content

Commit

Permalink
Sync with Vox Pupuli
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jun 18, 2024
1 parent a032e6a commit 8572c51
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 44 deletions.
45 changes: 40 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
name: noop run

on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- master
pull_request:
branches:
- master

jobs:
unit:
runs-on: ubuntu-latest
name: Run msync --noop against all modules
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run msync --noop
run: bundle exec msync update --noop --git-base=https://github.com/
run: bundle exec msync update --noop --git-base=https://github.com/ --branch foobranch
metadata_json_deps:
runs-on: ubuntu-latest
name: Run metadata_json_deps on all modules
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run msync --noop
run: bundle exec msync clone --git-base=https://github.com/
- run: bundle exec rake metadata_deps
outdated_module_summary:
runs-on: ubuntu-latest
name: Prints a list of all modules with outdated modulesync_config version
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run msync --noop
run: bundle exec msync clone --git-base=https://github.com/
- name: Generate summary
run: bundle exec bin/outdated_modules_and_their_version

tests:
needs:
- unit
- metadata_json_deps
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
16 changes: 7 additions & 9 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
extra_owners: []
.github/workflows/ci.yml:
excludes: []
pidfile_workaround: false
additional_packages: ''
acceptance_tests: true
main_branches: ['main']
# PDK creates this
.github/workflows/puppet-lint.yml:
delete: true
Expand All @@ -18,25 +17,21 @@ Gemfile:
required:
':test':
- gem: voxpupuli-test
version: '~> 7.0'
version: '~> 8.0'
- gem: coveralls
- gem: simplecov-console
- gem: puppet_metadata
version: '~> 3.0'
version: '~> 4.0'
':development':
- gem: guard-rake
- gem: overcommit
version: '>= 0.39.1'
':system_tests':
- gem: voxpupuli-acceptance
version: '~> 2.0'
version: '~> 3.0'
':release':
- gem: github_changelog_generator
version: '>= 1.16.1'
- gem: voxpupuli-release
version: '~> 3.0'
- gem: faraday-retry
version: '~> 2.1'
Rakefile:
config.user: opus-codium
# config.project: PROJECT
Expand Down Expand Up @@ -64,6 +59,8 @@ spec/acceptance/nodesets/centos-66-x64-pe.yml:
delete: true
spec/acceptance/nodesets/centos-7-x64.yml:
delete: true
spec/acceptance/nodesets/centos-7.yml:
delete: true
spec/acceptance/nodesets/centos-72-x64.yml:
delete: true
spec/acceptance/nodesets/debian-78-x64.yml:
Expand Down Expand Up @@ -116,6 +113,7 @@ spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml:
delete: true
spec/spec_helper.rb:
add_mocked_facts: true
facterdb_string_keys: false
mock_with: false
spec/spec_helper_acceptance.rb:
unmanaged: true
Expand Down
3 changes: 3 additions & 0 deletions moduleroot/.github/labeler.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
skip-changelog:
- head-branch: ['^release-*', 'release']
36 changes: 16 additions & 20 deletions moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

name: CI

on: pull_request
on:
pull_request: {}
push:
branches:
<%- @configs['main_branches'].each do |main_branch| -%>
- <%= main_branch %>
<%- end -%>

concurrency:
group: ${{ github.ref_name }}
Expand All @@ -14,27 +20,17 @@ jobs:
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'] %>'
<%- if @configs['unit_runs_on'] -%>
unit_runs_on: '<%= @configs['unit_runs_on'] %>'
<%- end -%>
<%- if @configs['acceptance_runs_on'] -%>
acceptance_runs_on: '<%= @configs['acceptance_runs_on'] %>'
<%- end -%>
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? || @configs.key?('unit_runs_on') -%>
with:
<%- end -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2
<%- end -%>
<%- unless @configs['additional_packages'].empty? -%>
additional_packages: '<%= @configs['additional_packages'] %>'
<%- if @configs['with'] -%>
with:
<%- @configs['with'].each do |k,v| -%>
<%- if v.is_a?(String) -%>
<%= k %>: '<%= v %>'
<%- else -%>
<%= k %>: <%= v %>
<%- end -%>
<%- if @configs.key?('rubocop') -%>
rubocop: <%= @configs['rubocop'] %>
<%- end -%>
<%- if Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].none? && @configs['unit_runs_on'] -%>
unit_runs_on: '<%= @configs['unit_runs_on'] %>'
<%- end -%>
14 changes: 14 additions & 0 deletions moduleroot/.github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Pull Request Labeler"

on:
pull_request_target: {}

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
13 changes: 12 additions & 1 deletion moduleroot/.github/workflows/release.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ on:
jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
with:
<%- if @configs['with'] -%>
<%- @configs['with'].each do |k,v| -%>
<%- if v.is_a?(String) -%>
<%= k %>: '<%= v %>'
<%- else -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
<%- end -%>
<%- unless @configs['with']&.has_key?('allowed_owner') -%>
allowed_owner: '<%= @configs[:namespace] %>'
<%- end -%>
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
Expand Down
4 changes: 3 additions & 1 deletion moduleroot/.gitignore.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
.*.sw?
/.yardoc/
/Guardfile
<% if ! @configs['paths'].nil? -%>
bolt-debug.log
.rerun.json
<% unless @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
<% end -%>
Expand Down
1 change: 1 addition & 0 deletions moduleroot/.pmtignore.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/.yardoc/
/.yardopts
/Dockerfile
/HISTORY.md
<% if ! @configs['paths'].nil? -%>
<% @configs['paths'].each do |path| -%>
<%= path %>
Expand Down
14 changes: 6 additions & 8 deletions moduleroot/spec/spec_helper.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
<%- if @configs['mock_with'] -%>

RSpec.configure do |c|
c.mock_with <%= @configs['mock_with'] %>
end
<%- end -%>

# puppetlabs_spec_helper will set up coverage if the env variable is set.
# We want to do this if lib exists and it hasn't been explicitly set.
ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))

require 'voxpupuli/test/spec_helper'
<%- if @configs['hiera_config'] -%>

RSpec.configure do |c|
c.facterdb_string_keys = <%= @configs['facterdb_string_keys'] %>
<%- if @configs['hiera_config'] -%>
c.hiera_config = <%= @configs['hiera_config'] %>
end
<%- end -%>
<%- if @configs['mock_with'] -%>
c.mock_with = <%= @configs['mock_with'] %>
<%- end -%>
end
<%- if @configs['add_mocked_facts'] -%>

add_mocked_facts!
Expand Down
4 changes: 4 additions & 0 deletions modulesync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
git_base: '[email protected]:'
namespace: opus-codium
branch: modulesync
message: "Update from Opus-Codium modulesync_config"
...
# vim: syntax=yaml

0 comments on commit 8572c51

Please sign in to comment.