Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit 0f5369a

Browse files
authored
Merge pull request #122 from OpenVoxProject/macos_in_gha
Changes to enable building all MacOS types on any MacOS host
2 parents 6d66dde + 2a2d6c9 commit 0f5369a

32 files changed

Lines changed: 56 additions & 186 deletions

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,33 @@ on:
1818
description: 'A comma-separated list of platforms to build for. Do not include spaces. If not provided, will use the default list of platform supported by OpenVox.'
1919
required: false
2020
type: string
21+
vanagon_branch:
22+
description: 'The branch of the vanagon repository to use'
23+
required: false
24+
type: string
25+
default: 'main'
26+
use_dev:
27+
description: 'Use the "dev" branch of the shared-actions repo'
28+
required: false
29+
type: boolean
30+
default: false
2131

2232
jobs:
2333
build:
34+
if: ${{ github.event.inputs.use_dev == 'false' }}
2435
uses: 'openvoxproject/shared-actions/.github/workflows/build_vanagon.yml@main'
2536
with:
2637
ref: ${{ inputs.ref }}
2738
project_name: ${{ inputs.project_name }}
2839
platform_list: ${{ inputs.platform_list }}
40+
vanagon_branch: ${{ inputs.vanagon_branch }}
41+
secrets: inherit
42+
build_dev:
43+
if: ${{ github.event.inputs.use_dev == 'true' }}
44+
uses: 'openvoxproject/shared-actions/.github/workflows/build_vanagon.yml@dev'
45+
with:
46+
ref: ${{ inputs.ref }}
47+
project_name: ${{ inputs.project_name }}
48+
platform_list: ${{ inputs.platform_list }}
49+
vanagon_branch: ${{ inputs.vanagon_branch }}
2950
secrets: inherit

acceptance/lib/puppet/acceptance/temp_file_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def root_group(host)
1919
'Administrators'
2020
when /aix/
2121
'system'
22-
when /osx|bsd/
22+
when /macos|bsd/
2323
'wheel'
2424
else
2525
'root'

acceptance/teardown/common/099_Archive_Logs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def file_glob(host, path)
8585
@logger.log_level = previous_level
8686
on(host, 'egrep -i \'reboot after panic\' /var/adm/messages', :acceptable_exit_codes => [0,1,2])
8787
@logger.log_level = :warn
88-
elsif host[:platform] =~ /osx/
88+
elsif host[:platform] =~ /macos/
8989
syslog_name = "system.log"
9090
elsif host[:platform] =~ /fedora/
9191
on(host, "journalctl --no-pager > /var/log/messages")

acceptance/tests/ensure_macos_executables_are_signed.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_name 'Ensure puppet executables are codesigned on mac OS' do
2-
confine :to, :platform => /osx/
2+
confine :to, :platform => /macos/
33
tag 'audit:high'
44

55
agents.each do |agent|

acceptance/tests/validate_vendored_ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def setup_build_environment(agent)
6565
end
6666

6767
def install_dependencies(agent)
68-
return if agent['platform'] =~ /osx|solaris-11|sparc/
68+
return if agent['platform'] =~ /macos|solaris-11|sparc/
6969

7070
install_package_on_agent = package_installer(agent)
7171
dependencies = {

configs/components/_base-module.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
# Rename appropriately for use with puppet
4747
"mv #{module_author}-#{module_name} #{target_directory}",
4848
# Remove git and CI-related files
49-
"rm -r #{File.join(target_directory, '.[!.]*')} 2>/dev/null",
49+
"rm -rf #{File.join(target_directory, '.[!.]*')}",
5050
]
5151
end

configs/components/pl-ruby-patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ruby_api_version = settings[:ruby_version].gsub(/\.\d*$/, '.0')
1717
ruby_version_y = settings[:ruby_version].gsub(/(\d+)\.(\d+)\.(\d+)/, '\1.\2')
1818

19-
base_ruby = if platform.name =~ /osx/
19+
base_ruby = if platform.name =~ /macos/
2020
"/usr/local/opt/ruby@#{ruby_version_y}/lib/ruby/#{ruby_api_version}"
2121
else
2222
"/opt/pl-build-tools/lib/ruby/2.1.0"

configs/components/puppet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
msgfmt = "/usr/bin/msgfmt.exe"
8686
elsif platform.is_macos?
8787
msgfmt = "/usr/local/opt/gettext/bin/msgfmt"
88-
if platform.architecture == 'arm64' && platform.os_version.to_i >= 13
88+
if platform.architecture == 'arm64'
8989
msgfmt = "/opt/homebrew/bin/msgfmt"
9090
end
9191
else
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
platform 'macos-all-arm64' do |plat|
2+
plat.inherit_from_default
3+
packages = %w[cmake pkg-config yaml-cpp]
4+
# We uninstall in case they are already installed, since GitHub Actions runners
5+
# will already have their own version and we want the homebrew core version.
6+
# We do || true so it doesn't fail if the packages don't exist. We have to do
7+
# it one by one because brew will not process the rest if one doesn't exist.
8+
packages.each do |pkg|
9+
plat.provision_with "brew uninstall #{pkg} 2>/dev/null || true && brew install #{pkg}"
10+
end
11+
plat.output_dir File.join('macos', 'all', 'arm64')
12+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
platform 'macos-all-x86_64' do |plat|
2+
plat.inherit_from_default
3+
plat.output_dir File.join('macos', 'all', 'x86_64')
4+
end

0 commit comments

Comments
 (0)