Skip to content

Merge pull request #2440 from tallpsmith/fix-nowebgroup-return #209

Merge pull request #2440 from tallpsmith/fix-nowebgroup-return

Merge pull request #2440 from tallpsmith/fix-nowebgroup-return #209

Workflow file for this run

name: macOS CI
on:
push:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Update Homebrew
run: brew update
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install python deps
id: install-python-deps
run: |
python3 --version
pip3 --version
pip3 install --upgrade pip
python3 -m venv pybuilddeps
source pybuilddeps/bin/activate
pip3 install setuptools wheel
python3 -c "import setuptools; print(setuptools.__version__)"
python3 -m pip install lxml openpyxl OrderedDict psycopg2-binary prometheus_client pyarrow pyodbc requests six
- name: Install Homebrew deps
id: install-brew-deps
run: |
brew install autoconf unixodbc
- name: Build on macOS
id: Build
run: |
source pybuilddeps/bin/activate
xcodebuild -version
./Makepkgs -verbose
- name: Debug on failure
if: failure() && steps.Build.conclusion == 'failure'
run: |
cat /Users/runner/work/pcp/pcp/Logs/pcp
- name: Debug on Python installation failure
if: failure() && steps.install-python-deps.conclusion == 'failure'
run: |
echo "Python 3.13 installation failed. Collecting debug info..."
brew --version
brew config
brew doctor
ls -la /usr/local/bin | grep python
df -h
brew list
- name: Debug on brew dependency installation failure
if: failure() && steps.install-brew-deps.conclusion == 'failure'
run: |
echo "Dependency installation failed. Collecting debug info..."
brew --version
brew config
brew doctor
ls -la /usr/local/bin | grep python
df -h
brew list
# Installation testing steps
- name: Mount DMG and Install PKG
if: success()
id: install-test
run: |
# Find the generated DMG
DMG_PATH=$(find pcp-**/build/mac -name "pcp-*.dmg" | head -1)
echo "Found DMG: $DMG_PATH"
# Mount the DMG
MOUNT_OUTPUT=$(hdiutil attach "$DMG_PATH" | tail -1)
VOLUME_PATH=$(echo "$MOUNT_OUTPUT" | awk '{print $3}')
echo "Mounted at: $VOLUME_PATH"
# Find and install the PKG
PKG_PATH=$(find "$VOLUME_PATH" -name "*.pkg" | head -1)
echo "Found PKG: $PKG_PATH"
# Install (sudo is passwordless in GitHub Actions)
sudo installer -pkg "$PKG_PATH" -target / -verbose
- name: Verify Installation
if: success() && steps.install-test.conclusion == 'success'
run: |
# Check critical binaries exist (will fail build if not found)
echo "Checking for installed binaries..."
which pminfo && echo "✓ pminfo found at $(which pminfo)"
which pmval && echo "✓ pmval found at $(which pmval)"
which pmlogger && echo "✓ pmlogger found at $(which pmlogger)"
# Check for expected directories (will fail build if not found)
echo "Checking for expected directories..."
test -d /etc/pcp && echo "✓ /etc/pcp exists"
test -d /var/lib/pcp && echo "✓ /var/lib/pcp exists"
- name: Cleanup - Unmount DMG
if: always()
run: |
# Unmount any mounted PCP volumes
hdiutil detach /Volumes/pcp* 2>/dev/null || true
# New steps for handling releases on version tags below
- name: Check if version tag
if: github.ref_type == 'tag'
id: check_tag
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ github.ref_name }}
regex: '^[0-9]+\.[0-9]+\.[0-9]+$'
flags: g # Global flag, but optional if just checking match
- name: Generate Github Summary - version tag detected
if: steps.check_tag.outputs.match != ''
run: |
echo "RELEASE DETECTED!" >> $GITHUB_STEP_SUMMARY
- name: Generate Github Summary - no version tag
if: steps.check_tag.outputs.match == ''
run: |
echo "Not a Release!" >> $GITHUB_STEP_SUMMARY
- name: Release
uses: softprops/action-gh-release@v2
if: steps.check_tag.outputs.match != ''
with:
files: |
pcp-**/build/mac/pcp-*.dmg