Merge pull request #19 from voxpupuli/modulesync

modulesync 5.3.0
This commit is contained in:
Tim Meusel 2022-10-02 15:35:07 +02:00 committed by GitHub
commit 132ae81120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 27 additions and 110 deletions

View file

@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as: you must set an environment variable such as:
```sh ```sh
export PUPPET_VERSION="~> 5.5.6" export PUPPET_GEM_VERSION="~> 6.1.0"
``` ```
You can install all needed gems for spec tests into the modules directory by You can install all needed gems for spec tests into the modules directory by
@ -232,17 +232,16 @@ simple tests against it after applying the module. You can run this
with: with:
```sh ```sh
BEAKER_setfile=debian10-x64 bundle exec rake beaker BEAKER_setfile=debian11-64 bundle exec rake beaker
``` ```
You can replace the string `debian10` with any common operating system. You can replace the string `debian10` with any common operating system.
The following strings are known to work: The following strings are known to work:
* ubuntu1604
* ubuntu1804 * ubuntu1804
* ubuntu2004 * ubuntu2004
* debian9
* debian10 * debian10
* debian11
* centos7 * centos7
* centos8 * centos8

View file

@ -7,84 +7,12 @@ name: CI
on: pull_request on: pull_request
concurrency: concurrency:
group: ${{ github.head_ref }} group: ${{ github.ref_name }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
setup_matrix: puppet:
name: 'Setup Test Matrix' name: Puppet
runs-on: ubuntu-latest uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
timeout-minutes: 40 with:
outputs: pidfile_workaround: 'false'
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 false
unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: 40
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
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)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
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 }}
tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed

View file

@ -9,26 +9,14 @@ on:
tags: tags:
- '*' - '*'
env:
BUNDLE_WITHOUT: development:test:system_tests
jobs: jobs:
deploy: release:
name: 'deploy to forge' name: Release
runs-on: ubuntu-latest uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
if: github.repository_owner == 'voxpupuli' with:
steps: allowed_owner: 'voxpupuli'
- name: Checkout repository secrets:
uses: actions/checkout@v2 # Configure secrets here:
- name: Setup Ruby # https://docs.github.com/en/actions/security-guides/encrypted-secrets
uses: ruby/setup-ruby@v1 username: ${{ secrets.PUPPET_FORGE_USERNAME }}
with: api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
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

View file

@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT # Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
modulesync_config_version: '5.1.0' modulesync_config_version: '5.3.0'

View file

@ -8,7 +8,7 @@ WORKDIR /opt/puppet
# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39 # https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv RUN mkdir -p /etc/sv
ARG PUPPET_VERSION="~> 6.0" ARG PUPPET_GEM_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4 ARG PARALLEL_TEST_PROCESSORS=4
# Cache gems # Cache gems

View file

@ -1,10 +1,10 @@
# Managed by modulesync - DO NOT EDIT # Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
source ENV['GEM_SOURCE'] || "https://rubygems.org" source ENV['GEM_SOURCE'] || 'https://rubygems.org'
group :test do group :test do
gem 'voxpupuli-test', '~> 5.0', :require => false gem 'voxpupuli-test', '~> 5.4', :require => false
gem 'coveralls', :require => false gem 'coveralls', :require => false
gem 'simplecov-console', :require => false gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 1.0', :require => false gem 'puppet_metadata', '~> 1.0', :require => false
@ -29,7 +29,7 @@ end
gem 'rake', :require => false gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]
puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0' puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test] gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby # vim: syntax=ruby

View file

@ -52,7 +52,7 @@ begin
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
config.user = 'voxpupuli' config.user = 'voxpupuli'
config.project = metadata.metadata['name'] config.project = 'puppet-hashi_stack'
end end
# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715

View file

@ -9,6 +9,8 @@ ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))
require 'voxpupuli/test/spec_helper' require 'voxpupuli/test/spec_helper'
add_mocked_facts!
if File.exist?(File.join(__dir__, 'default_module_facts.yml')) if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
facts&.each do |name, value| facts&.each do |name, value|