Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
- uses: actions/add-to-project@v2
with:
project-url: https://github.com/orgs/simp/projects/11
github-token: ${{ secrets.AUTO_TRIAGE_TOKEN }}
10 changes: 5 additions & 5 deletions modules/profile/files/_github/workflows/release_rpms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
${{ (github.event.inputs.target_repo != null && format('{0}/{1}', github.repository_owner, github.event.inputs.target_repo)) || github.repository }}
${{ github.event.inputs.release_tag }}
(build os: ${{ github.event.inputs.build_container_os }})
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: "Validate inputs"
id: validate-inputs
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
env:
AUTOCREATE_RELEASE: ${{ github.event.inputs.autocreate_release }}
PREBUILD_TAG: ${{ steps.validate-inputs.outputs.prebuild_suffix }}
uses: actions/github-script@v6
uses: actions/github-script@v9
with:
github-token: ${{ github.event.inputs.target_repo_token || secrets.GITHUB_TOKEN }}
script: |
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
)

- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v7
with:
repository: ${{ env.TARGET_REPO }}
ref: ${{ env.RELEASE_TAG }}
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:

- name: "Wipe all previous assets from GitHub Release (when clean == 'yes')"
if: ${{ github.event.inputs.clean == 'yes' && github.event.inputs.dry_run != 'yes' }}
uses: actions/github-script@v6
uses: actions/github-script@v9
env:
release_id: ${{ steps.release-api.outputs.id }}
with:
Expand All @@ -278,7 +278,7 @@ jobs:

- name: "Upload RPM file(s) to GitHub Release (dry_run != 'yes')"
if: ${{ github.event.inputs.dry_run != 'yes' }}
uses: actions/github-script@v6
uses: actions/github-script@v9
env:
rpm_file_paths: ${{ steps.build-and-sign-rpm.outputs.rpm_file_paths }}
rpm_gpg_file: ${{ steps.build-and-sign-rpm.outputs.rpm_gpg_file }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'

env:
PUPPET_VERSION: '~> 7'
PUPPET_VERSION: '~> 8'

jobs:
create-github-release:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'

env:
PUPPET_VERSION: '~> 7'
PUPPET_VERSION: '~> 8'
LOCAL_WORKFLOW_CONFIG_FILE: .github/workflows.local.json

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'

env:
PUPPET_VERSION: '~> 7'
PUPPET_VERSION: '~> 8'
LOCAL_WORKFLOW_CONFIG_FILE: .github/workflows.local.json

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'

env:
PUPPET_VERSION: '~> 7'
PUPPET_VERSION: '~> 8'
LOCAL_WORKFLOW_CONFIG_FILE: .github/workflows.local.json

jobs:
Expand Down
35 changes: 21 additions & 14 deletions modules/profile/files/pupmod/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,32 @@
# ------------------------------------------------------------------------------
gem_sources = ENV.fetch('GEM_SERVERS', 'https://rubygems.org').split(%r{[, ]+})

ENV['PDK_DISABLE_ANALYTICS'] ||= 'true'

gem_sources.each { |gem_source| source gem_source }

group :test do
puppet_version = ENV.fetch('PUPPET_VERSION', ['>= 7', '< 9'])
major_puppet_version = Array(puppet_version).first.scan(%r{(\d+)(?:\.|\Z)}).flatten.first.to_i
gem 'hiera-puppet-helper'
group :syntax do
gem 'metadata-json-lint'
gem 'pathspec', '~> 2.0' if Gem::Requirement.create('< 2.6').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem('pdk', ENV.fetch('PDK_VERSION', ['>= 2.0', '< 4.0']), require: false) if major_puppet_version > 5
gem 'puppet', puppet_version
gem 'puppetlabs_spec_helper'
gem 'puppet-lint-trailing_comma-check', require: false
gem 'puppet-strings'
# rubocop, rubocop-rake, and rubocop-rspec are pulled in and version-pinned by
# voxpupuli-test (via simp-rake-helpers); pinning them here conflicts with its
# constraints. rubocop-performance is not a voxpupuli-test dependency, so it
# stays explicit.
gem 'rubocop-performance', '~> 1.26.0'
end

group :test do
puppet_version = ENV.fetch('PUPPET_VERSION', ['>= 8', '< 9'])
openvox_version = ENV.fetch('OPENVOX_VERSION', puppet_version)
gem 'hiera-puppet-helper'
gem 'openvox', openvox_version
gem 'openvox-strings'
gem 'rake'
gem 'rspec'
gem 'rspec-puppet'
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.21.0', '< 6'])
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 3.7')
# renovate: datasource=rubygems versioning=ruby
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 6.0')
# renovate: datasource=rubygems versioning=ruby
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 4.0.0')
gem 'syslog', require: false
end

group :development do
Expand All @@ -38,7 +44,8 @@ group :system_tests do
gem 'bcrypt_pbkdf'
gem 'beaker'
gem 'beaker-rspec'
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', ['>= 1.32.1', '< 2'])
# renovate: datasource=rubygems versioning=ruby
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 3.1')
end

# Evaluate extra gemfiles if they exist
Expand Down
116 changes: 66 additions & 50 deletions modules/profile/files/pupmod/_github/workflows/pr_tests.simp-simp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,50 @@
#
# ==============================================================================
#
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# PE 2019.8 6.22 2.5 2022-12 (LTS)
# PE 2021.Y 7.x 2.7 Quarterly updates
#
# https://puppet.com/docs/pe/latest/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# ==============================================================================
#
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
#

---
name: PR Tests
on:
'on':
pull_request:
types: [opened, reopened, synchronize]

env:
PUPPET_VERSION: '~> 7'

jobs:
puppet-syntax:
name: 'Puppet Syntax'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
- uses: actions/checkout@v7
- name: "Install Ruby 3.2"
uses: ruby/setup-ruby@v1 # ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
with:
ruby-version: 2.7
ruby-version: 3.2.11
bundler-cache: true
- run: "bundle exec rake syntax"

puppet-style:
name: 'Puppet Style'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
- uses: actions/checkout@v7
- name: "Install Ruby 3.2"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2.11
bundler-cache: true
- run: "bundle exec rake lint"
- run: "bundle exec rake metadata_lint"

ruby-style:
if: false # TODO Modules will need: rubocop in Gemfile, .rubocop.yml
name: 'Ruby Style (experimental)'
name: 'Ruby Style'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v5
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
- uses: actions/checkout@v7
- name: "Install Ruby 3.4"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.4.9
bundler-cache: true
- run: |
bundle show
Expand All @@ -75,11 +61,11 @@ jobs:
name: 'File checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: 'Install Ruby 2.7'
- uses: actions/checkout@v7
- name: 'Install Ruby 3.4'
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.4.9
bundler-cache: true
- run: bundle exec rake check:dot_underscore
- run: bundle exec rake check:test_file
Expand All @@ -88,19 +74,19 @@ jobs:
name: 'RELENG checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
- uses: actions/checkout@v7
- name: 'Install Ruby 3.4'
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.4.9
bundler-cache: true
- name: 'Tags and changelogs'
run: |
bundle exec rake pkg:check_version
bundle exec rake pkg:compare_latest_tag[,true]
bundle exec rake pkg:create_tag_changelog
- name: 'Test-build the Puppet module'
run: 'bundle exec pdk build --force'
run: 'bundle exec rake pupmod:build'

spec-tests:
name: 'Spec (${{matrix.test_suite.label}}, ${{matrix.puppet.label}})'
Expand All @@ -109,14 +95,20 @@ jobs:
strategy:
matrix:
puppet:
- label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
puppet_version: '~> 7.0'
ruby_version: '2.7'
experimental: false
- label: 'Puppet 8.x'
- label: 'OpenVox 8.x (Ruby 3.2)'
puppet_version: '~> 8.0'
ruby_version: '3.2'
experimental: false
- label: 'OpenVox 8.x (Ruby 3.4)'
puppet_version: '~> 8.0'
ruby_version: '3.4'
experimental: false
# OpenVox 9 is unreleased; preview the future Ruby 4.0 / OpenVox 9
# combo by running the OpenVox 8 gem on Ruby 4.0.
- label: 'OpenVox 9.x preview (Ruby 4.0, OpenVox 8 gem)'
puppet_version: '~> 8.0'
ruby_version: '4.0'
experimental: false
test_suite:
- label: classes 01
run: bundle exec rspec spec/classes/01_classes
Expand All @@ -132,13 +124,11 @@ jobs:
run: bundle exec rspec spec/functions
- label: aliases
run: bundle exec rspec spec/type_aliases
- label: unit
run: bundle exec rspec spec/unit
fail-fast: false
env:
PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
- name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
uses: ruby/setup-ruby@v1
with:
Expand All @@ -149,12 +139,38 @@ jobs:
- run: ${{matrix.test_suite.run}}
continue-on-error: ${{matrix.puppet.experimental}}

# dump_contexts:
# name: 'Examine Context contents'
# runs-on: ubuntu-latest
# steps:
# - name: Dump contexts
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
#
acceptance:
runs-on:
- ubuntu-latest
strategy:
matrix:
node:
- almalinux8
- almalinux9
- almalinux10
suite:
- default
- base_apps
fail-fast: false
steps:
- name: checkout repo
uses: actions/checkout@v7
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.9
- name: bundle install
run: |
bundle install
- name: Setup libvirt for Vagrant
run: |
sudo add-apt-repository ppa:evgeni/vagrant
sudo apt-get update
sudo apt-get install -y --no-install-recommends vagrant vagrant-libvirt libvirt-daemon-system libvirt-daemon qemu-system-x86 qemu-utils dnsmasq
sudo chmod 666 /var/run/libvirt/libvirt-sock
- name: beaker
env:
BEAKER_HYPERVISOR: 'vagrant_libvirt'
VAGRANT_DEFAULT_PROVIDER: 'libvirt'
run: |
bundle exec rake beaker:suites[${{ matrix.suite}},${{ matrix.node }}]
Loading