|
| 1 | +# .github/workflows/cross-platform-build-verification.yml |
| 2 | +name: Cross-Platform Build Verification |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [main, development] |
| 7 | + pull_request: |
| 8 | + branches: [main] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-matrix: |
| 13 | + name: ${{ matrix.label }} |
| 14 | + runs-on: ${{ matrix.runner }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + # Self-hosted (VERIFIED hardware) |
| 20 | + - runner: [self-hosted, linux, x64] |
| 21 | + label: "Linux x86_64 (self-hosted)" |
| 22 | + |
| 23 | + - runner: [self-hosted, macos, x64] |
| 24 | + label: "macOS x86_64 Intel (self-hosted)" |
| 25 | + |
| 26 | + # GitHub-hosted (documented guarantees) |
| 27 | + - runner: ubuntu-latest |
| 28 | + label: "Ubuntu x86_64" |
| 29 | + |
| 30 | + - runner: ubuntu-24.04-arm64 |
| 31 | + label: "Ubuntu ARM64 (aarch64)" |
| 32 | + |
| 33 | + - runner: windows-latest |
| 34 | + label: "Windows x86_64" |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Set up Python 3.11 |
| 41 | + uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: '3.11' |
| 44 | + |
| 45 | + - name: Verify Architecture |
| 46 | + id: arch |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + ARCH=$(uname -m) |
| 50 | + OS=$(uname -s) |
| 51 | + echo "Detected: $OS $ARCH" |
| 52 | + echo "arch=$ARCH" >> $GITHUB_OUTPUT |
| 53 | + echo "os=$OS" >> $GITHUB_OUTPUT |
| 54 | + |
| 55 | + # Hard fail if architecture is not what we expect |
| 56 | + if [[ "${{ matrix.label }}" == *"ARM64"* ]] && [[ "$ARCH" != "aarch64" ]] && [[ "$ARCH" != "arm64" ]]; then |
| 57 | + echo "ERROR: Expected ARM64 but got $ARCH" |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | + |
| 61 | + - name: Build and Test |
| 62 | + shell: bash |
| 63 | + run: | |
| 64 | + python -m pip install --upgrade pip build |
| 65 | + python -m build |
| 66 | + pip install dist/*.whl |
| 67 | + omnipkg --version |
| 68 | + 8pkg --version |
| 69 | + omnipkg list |
| 70 | + |
| 71 | + - name: Record Verified Platform |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + echo "✅ VERIFIED: ${{ steps.arch.outputs.os }} ${{ steps.arch.outputs.arch }}" |
| 75 | +
|
| 76 | + # Rootless Podman on self-hosted (safe for iptables/Tailscale) |
| 77 | + linux-distros-podman: |
| 78 | + name: Podman - ${{ matrix.distro }} |
| 79 | + runs-on: [self-hosted, linux, x64] |
| 80 | + strategy: |
| 81 | + fail-fast: false |
| 82 | + matrix: |
| 83 | + distro: |
| 84 | + - debian:12 |
| 85 | + - ubuntu:24.04 |
| 86 | + - fedora:39 |
| 87 | + |
| 88 | + steps: |
| 89 | + - name: Checkout |
| 90 | + uses: actions/checkout@v4 |
| 91 | + |
| 92 | + - name: Test in ${{ matrix.distro }} (Podman) |
| 93 | + run: | |
| 94 | + podman run --rm -v $(pwd):/workspace:Z ${{ matrix.distro }} /bin/bash -c " |
| 95 | + cd /workspace |
| 96 | + if command -v apt-get &> /dev/null; then |
| 97 | + apt-get update && apt-get install -y python3 python3-pip python3-venv |
| 98 | + elif command -v dnf &> /dev/null; then |
| 99 | + dnf install -y python3 python3-pip |
| 100 | + fi |
| 101 | + python3 -m pip install --upgrade pip build |
| 102 | + python3 -m build |
| 103 | + python3 -m pip install dist/*.whl |
| 104 | + omnipkg --version |
| 105 | + " |
| 106 | +
|
| 107 | + # Docker on GitHub-hosted (plenty of space/memory, split for safety) |
| 108 | + linux-distros-docker-debian: |
| 109 | + name: Docker - Debian/Ubuntu |
| 110 | + runs-on: ubuntu-latest |
| 111 | + strategy: |
| 112 | + fail-fast: false |
| 113 | + matrix: |
| 114 | + distro: |
| 115 | + - debian:12 |
| 116 | + - debian:11 |
| 117 | + - ubuntu:24.04 |
| 118 | + - ubuntu:22.04 |
| 119 | + - ubuntu:20.04 |
| 120 | + |
| 121 | + steps: |
| 122 | + - name: Checkout |
| 123 | + uses: actions/checkout@v4 |
| 124 | + |
| 125 | + - name: Test in ${{ matrix.distro }} |
| 126 | + run: | |
| 127 | + docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c " |
| 128 | + cd /workspace |
| 129 | + apt-get update && apt-get install -y python3 python3-pip python3-venv |
| 130 | + python3 -m pip install --upgrade pip build |
| 131 | + python3 -m build |
| 132 | + python3 -m pip install dist/*.whl |
| 133 | + omnipkg --version |
| 134 | + " |
| 135 | +
|
| 136 | + linux-distros-docker-rhel: |
| 137 | + name: Docker - RHEL/Fedora |
| 138 | + runs-on: ubuntu-latest |
| 139 | + strategy: |
| 140 | + fail-fast: false |
| 141 | + matrix: |
| 142 | + distro: |
| 143 | + - fedora:39 |
| 144 | + - fedora:38 |
| 145 | + - rockylinux:9 |
| 146 | + - rockylinux:8 |
| 147 | + - almalinux:9 |
| 148 | + |
| 149 | + steps: |
| 150 | + - name: Checkout |
| 151 | + uses: actions/checkout@v4 |
| 152 | + |
| 153 | + - name: Test in ${{ matrix.distro }} |
| 154 | + run: | |
| 155 | + docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c " |
| 156 | + cd /workspace |
| 157 | + dnf install -y python3 python3-pip |
| 158 | + python3 -m pip install --upgrade pip build |
| 159 | + python3 -m build |
| 160 | + python3 -m pip install dist/*.whl |
| 161 | + omnipkg --version |
| 162 | + " |
| 163 | +
|
| 164 | + linux-distros-docker-other: |
| 165 | + name: Docker - Arch/Alpine |
| 166 | + runs-on: ubuntu-latest |
| 167 | + strategy: |
| 168 | + fail-fast: false |
| 169 | + matrix: |
| 170 | + distro: |
| 171 | + - archlinux:latest |
| 172 | + - alpine:latest |
| 173 | + |
| 174 | + steps: |
| 175 | + - name: Checkout |
| 176 | + uses: actions/checkout@v4 |
| 177 | + |
| 178 | + - name: Test in ${{ matrix.distro }} |
| 179 | + run: | |
| 180 | + docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/sh -c " |
| 181 | + cd /workspace |
| 182 | + if command -v pacman &> /dev/null; then |
| 183 | + pacman -Sy --noconfirm python python-pip |
| 184 | + elif command -v apk &> /dev/null; then |
| 185 | + apk add --no-cache python3 py3-pip |
| 186 | + fi |
| 187 | + python3 -m pip install --upgrade pip build |
| 188 | + python3 -m build |
| 189 | + python3 -m pip install dist/*.whl |
| 190 | + omnipkg --version |
| 191 | + " |
| 192 | +
|
| 193 | + generate-badge: |
| 194 | + name: Generate Platform Support Badge |
| 195 | + needs: [build-matrix, linux-distros-podman, linux-distros-docker-debian, linux-distros-docker-rhel, linux-distros-docker-other] |
| 196 | + runs-on: ubuntu-latest |
| 197 | + if: always() && github.ref == 'refs/heads/main' |
| 198 | + steps: |
| 199 | + - name: Checkout |
| 200 | + uses: actions/checkout@v4 |
| 201 | + |
| 202 | + - name: Generate badge JSON |
| 203 | + run: | |
| 204 | + cat > platform-support.json << 'EOF' |
| 205 | + { |
| 206 | + "schemaVersion": 1, |
| 207 | + "label": "platforms", |
| 208 | + "message": "Linux | macOS | Windows", |
| 209 | + "color": "brightgreen" |
| 210 | + } |
| 211 | + EOF |
| 212 | + |
| 213 | + cat > arch-support.json << 'EOF' |
| 214 | + { |
| 215 | + "schemaVersion": 1, |
| 216 | + "label": "verified", |
| 217 | + "message": "x86_64 | Linux ARM64", |
| 218 | + "color": "blue" |
| 219 | + } |
| 220 | + EOF |
| 221 | + |
| 222 | + - name: Commit badge data |
| 223 | + run: | |
| 224 | + git config user.name "github-actions[bot]" |
| 225 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 226 | + git add platform-support.json arch-support.json |
| 227 | + git diff --staged --quiet || git commit -m "Update platform support badges [skip ci]" |
| 228 | + git push |
| 229 | +``` |
| 230 | +
|
| 231 | +**Key changes:** |
| 232 | +1. ✅ **Podman on self-hosted** - Won't touch iptables, safe for Tailscale |
| 233 | +2. ✅ **Docker split into 3 jobs on GitHub runners** - Avoids memory/space issues |
| 234 | +3. ✅ **Minimal distros on self-hosted** - Just Debian, Ubuntu, Fedora via Podman |
| 235 | +4. ✅ **Heavy testing on GitHub** - RHEL, Rocky, Alma, Arch, Alpine via Docker |
| 236 | +
|
| 237 | +Your self-hosted runner stays safe, GitHub does the heavy lifting! |
0 commit comments