name: CI arm64 Build and Test
on:
workflow_dispatch:
inputs:
runner_type:
description: 'Runner type to use (for testing only)'
required: true
default: 'self-hosted'
type: choice
options:
- self-hosted
- emulation-test
permissions:
contents: read
jobs:
arm64-build-test:
name: ARM64 Build and Test (Self-Hosted)
runs-on: ${{ github.event.inputs.runner_type == 'self-hosted' && fromJSON('["self-hosted", "linux", "ARM64"]') || 'ubuntu-latest' }}
timeout-minutes: 45 permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up QEMU (emulation mode only)
if: ${{ github.event.inputs.runner_type == 'emulation' }}
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Verify architecture
run: |
echo "๐ Verifying runner architecture"
echo "Architecture: $(uname -m)"
echo "Runner: ${{ runner.name }}"
echo "OS: $(uname -s)"
# For self-hosted, should show aarch64 or arm64
# For emulation, will show x86_64 but QEMU provides arm64
if [ "$(uname -m)" = "x86_64" ] && [ "${{ github.event.inputs.runner_type }}" = "self-hosted" ]; then
echo "โ ERROR: Expected ARM64 but got x86_64"
echo "This means the runner is NOT actually ARM64 native"
exit 1
fi
echo "โ
Architecture check passed"
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: arm64-${{ github.event.inputs.runner_type }}
- name: Configure build parallelism
run: |
# Increase parallelism for faster builds
echo "CARGO_BUILD_JOBS=$(nproc)" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
echo "Architecture: $(uname -m)"
echo "Available cores: $(nproc)"
echo "Memory: $(free -h | grep Mem | awk '{print $2}')"
- name: Build tool binary (arm64)
timeout-minutes: 20 run: |
echo "๐จ Building embeddenator for ARM64"
echo "Runner type: ${{ github.event.inputs.runner_type }}"
cargo build --release --verbose
- name: Run full test suite (arm64)
if: ${{ github.event.inputs.runner_type != 'test-only' }}
timeout-minutes: 25 run: |
echo "๐งช Running full test suite on ARM64"
cargo test --verbose
- name: Run integration tests via orchestrator (arm64)
if: ${{ github.event.inputs.runner_type != 'test-only' }}
timeout-minutes: 15
run: |
echo "๐ง Running orchestrator integration tests"
python3 orchestrator.py --mode build --verbose
python3 orchestrator.py --mode test --verbose
- name: Upload build logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-arm64-${{ github.event.inputs.runner_type }}
path: |
/tmp/*.log
retention-days: 7
- name: Report build metrics
if: always()
run: |
echo "## ARM64 Build Metrics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Architecture:** $(uname -m)" >> $GITHUB_STEP_SUMMARY
echo "**Runner Type:** ${{ github.event.inputs.runner_type }}" >> $GITHUB_STEP_SUMMARY
echo "**Runner Name:** ${{ runner.name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### System Resources" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "Memory:" >> $GITHUB_STEP_SUMMARY
free -h >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "CPU:" >> $GITHUB_STEP_SUMMARY
lscpu | grep -E "^CPU\(s\)|Model name|Thread|Core|Architecture" >> $GITHUB_STEP_SUMMARY || echo "lscpu not available" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Load:" >> $GITHUB_STEP_SUMMARY
uptime >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ github.event.inputs.runner_type }}" = "emulation" ]; then
echo "โ ๏ธ **Note:** Running in emulation mode (slower performance)" >> $GITHUB_STEP_SUMMARY
fi