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

Add Arch Linux support #37

Merged
merged 2 commits into from
Feb 14, 2022
Merged
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
2 changes: 1 addition & 1 deletion lib/puppet_metadata/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: fals
# Return whether a Beaker setfile can be generated for the given OS
# @param [String] os The operating system
def os_supported?(os)
['CentOS', 'Fedora', 'Debian', 'Ubuntu'].include?(os)
['Archlinux', 'CentOS', 'Fedora', 'Debian', 'Ubuntu'].include?(os)
end

private
Expand Down
47 changes: 32 additions & 15 deletions lib/puppet_metadata/github_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,42 @@ def puppet_unit_test_matrix
end.compact
end

def github_action_test_matrix(use_fqdn: false, pidfile_workaround: false)
metadata.operatingsystems.each_with_object([]) do |(os, releases), matrix_include|
releases&.each do |release|
puppet_major_versions.each do |puppet_version|
next unless AIO.has_aio_build?(os, release, puppet_version[:value])

setfile = PuppetMetadata::Beaker.os_release_to_setfile(os, release, use_fqdn: use_fqdn, pidfile_workaround: pidfile_workaround)
next unless setfile
def beaker_os_releases
majors = puppet_major_versions

matrix_include << {
setfile: {
name: setfile[1],
value: setfile[0],
},
puppet: puppet_version
}
metadata.operatingsystems.each do |os, releases|
case os
when 'Archlinux', 'Gentoo'
yield [os, 'rolling', majors.max_by { |v| v[:value] }]
else
releases&.each do |release|
majors.each do |puppet_version|
if AIO.has_aio_build?(os, release, puppet_version[:value])
yield [os, release, puppet_version]
end
end
end
end
end
end

def github_action_test_matrix(use_fqdn: false, pidfile_workaround: false)
matrix_include = []
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not as pretty as I'd like - yield in Python feels much more natural than in Ruby.


beaker_os_releases do |os, release, puppet_version|
setfile = PuppetMetadata::Beaker.os_release_to_setfile(os, release, use_fqdn: use_fqdn, pidfile_workaround: pidfile_workaround)
next unless setfile

matrix_include << {
setfile: {
name: setfile[1],
value: setfile[0],
},
puppet: puppet_version
}
end

matrix_include
end
end
end