Skip to content

Commit

Permalink
UnixPB: Only Install CMake on mac where not already present. (adoptiu…
Browse files Browse the repository at this point in the history
…m#3544)

* UnixPB: Only Install CMake on mac where not already present.

* GHA: Fix keyserver name resolution

* Syntax fix

* Syntax fix

* Test

* Fix path

* Test alt solution

* Test 2

* Revert test

* Update ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/MacOSX.yml

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>

* Add comment about why this fix is needed.

* GHA: replace macos11 with macos13

Replace macos11 with 13, and improve cmake check logic

---------

Co-authored-by: Martijn Verburg <martijnverburg@gmail.com>
  • Loading branch information
steelhead31 and karianna authored May 3, 2024
1 parent 8d4435e commit 0b0553e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- .github/workflows/build_mac.yml
- ansible/playbooks/AdoptOpenJDK_Unix_Playbook/**
branches:
branches:
- master

permissions:
Expand All @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
include:
- os: [macos-11]
- os: [macos-13]
- os: [macos-14]
steps:

Expand All @@ -27,6 +27,13 @@ jobs:
- name: Install dependencies
run: brew install ansible

# This is to fix an issue with the github macos14 runner, that cant resolve keyserver.ubuntu.com
# but this does work when replaced with the IP address. Spotted during the GPG verification of ANT step
# Upstream Bug : https://github.com/actions/runner-images/issues/9777
- name: Replace keyserver address with IP address
run: |
sed -i '' 's/keyserver\.ubuntu\.com/185.125.188.27/g' ansible/playbooks/Supporting_Scripts/package_signature_verification.sh
- name: Run Ansible Playbook
run: |
echo "localhost ansible_user=runner ansible_connection=local" > ansible/hosts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,26 @@
with_items: "{{ Build_Tool_Packages }}"
tags: build_tools

# Install CMAKE Where It Doesn't exist
- name: Check if cmake is installed in /opt/homebrew/bin
stat:
path: /opt/homebrew/bin/cmake
register: cmake_homebrew

- name: Check if cmake is installed in /usr/local/bin
stat:
path: /usr/local/bin/cmake
register: cmake_local

- name: Install Cmake
become: yes
become_user: "{{ ansible_user }}"
homebrew:
name: "cmake"
state: present
tags: build_tools
when: not (cmake_homebrew.stat.exists or cmake_local.stat.exists)

- name: Install Build Tool Packages NOT macOS 10.12
become: yes
become_user: "{{ ansible_user }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Build_Tool_Packages:
- autoconf
- automake # for compiling freetype on JDK8u
- cmake # OpenJ9
- coreutils
- gnupg
- gnu-sed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ while [[ $# -gt 0 ]]; do
;;
-k)
KEY="$2"
shift 2
shift 2
;;
-*|--*)
echo "Unknown option $1"
Expand Down

0 comments on commit 0b0553e

Please sign in to comment.