Skip to content

macOS ARM64 Verification #44

macOS ARM64 Verification

macOS ARM64 Verification #44

name: macOS ARM64 Verification
on:
push:
branches:
- main
- master
paths:
- 'scripts/download-launch-mac-arm64.sh'
- '.github/workflows/mac-arm64-verification.yml'
pull_request:
paths:
- 'scripts/download-launch-mac-arm64.sh'
- '.github/workflows/mac-arm64-verification.yml'
workflow_dispatch:
inputs:
version:
description: 'Specific HagiCode version to test (leave empty for latest)'
required: false
default: ''
type: string
jobs:
mac-arm64-test:
name: Test on macOS ARM64
runs-on: macos-14
timeout-minutes: 15
env:
HAGICODE_VERSION: ${{ github.event.inputs.version || 'latest' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Display runner information
run: |
echo "=== Runner Information ==="
echo "OS: $(uname -s)"
echo "Architecture: $(uname -m)"
echo "macOS Version: $(sw_vers -productVersion)"
- name: Install .NET 10 Runtime
run: |
echo "=== Installing .NET 10 SDK ==="
curl -sSL https://dotnet/v1/dotnet-install.sh | bash -s -- --channel 10.0
export DOTNET_ROOT="$HOME/.dotnet"
export PATH="$DOTNET_ROOT:$PATH"
echo "DOTNET_ROOT=$DOTNET_ROOT" >> $GITHUB_ENV
echo "$DOTNET_ROOT" >> $GITHUB_PATH
dotnet --info
- name: Run download and launch script
id: launch
env:
HAGICODE_DIR: ${{ runner.temp }}/hagicode-mac-arm64
run: |
bash scripts/download-launch-mac-arm64.sh
- name: Start application in background
env:
HAGICODE_DIR: ${{ runner.temp }}/hagicode-mac-arm64
run: |
echo "=== Starting Application in Background ==="
cd "$HAGICODE_DIR"
nohup bash start.sh > app.log 2>&1 &
APP_PID=$!
echo "Application PID: $APP_PID"
echo "Waiting for startup..."
sleep 5
if kill -0 $APP_PID 2>/dev/null; then
echo "Application is running (PID: $APP_PID)"
echo "$APP_PID" > app.pid
else
echo "ERROR: Application failed to start"
cat app.log
exit 1
fi
- name: Monitor application
env:
HAGICODE_DIR: ${{ runner.temp }}/hagicode-mac-arm64
run: |
echo "=== Monitoring Application ==="
cd "$HAGICODE_DIR"
for i in {1..5}; do
sleep 2
if [ -f app.log ]; then
echo "Log check $i:"
tail -3 app.log || true
fi
done
if [ -f app.pid ]; then
PID=$(cat app.pid)
if kill -0 $PID 2>/dev/null; then
echo "SUCCESS: Application is still running"
tail -20 app.log || true
else
echo "WARNING: Application stopped during monitoring"
tail -50 app.log || true
fi
else
echo "ERROR: No PID file found"
exit 1
fi
- name: Upload diagnostic artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: mac-arm64-logs-${{ github.run_id }}
path: |
${{ runner.temp }}/hagicode-mac-arm64/
retention-days: 7
- name: Summary
if: ${{ always() }}
run: |
echo "### macOS ARM64 Verification Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Platform:** macos-14 (ARM64)" >> $GITHUB_STEP_SUMMARY
echo "**Version Tested:** $HAGICODE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat ${{ runner.temp }}/hagicode-mac-arm64/app.log >> $GITHUB_STEP_SUMMARY || echo "No application logs available" >> $GITHUB_STEP_SUMMARY