Skip to content

Commit 47206c6

Browse files
authored
Update cross-platform-build-verification.yml
1 parent a97e9cf commit 47206c6

1 file changed

Lines changed: 10 additions & 247 deletions

File tree

Lines changed: 10 additions & 247 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,4 @@
1-
name: Cross-Platform Build Verification
2-
3-
on:
4-
release:
5-
types: [published]
6-
workflow_dispatch:
7-
inputs:
8-
target_ref:
9-
description: 'Git Ref to verify (e.g. v2.0.6). Leave empty to use current ref.'
10-
required: false
11-
type: string
12-
default: ''
13-
14-
jobs:
15-
# ═══════════════════════════════════════════════════════════════════
16-
# 1. BUILD MATRIX
17-
# ═══════════════════════════════════════════════════════════════════
18-
build-matrix:
19-
name: ${{ matrix.label }}
20-
runs-on: ${{ matrix.runner }}
21-
strategy:
22-
fail-fast: false
23-
matrix:
24-
include:
25-
- runner: [self-hosted, linux, x64]
26-
label: "Linux x86_64 (self-hosted)"
27-
- runner: [self-hosted, macos, x64]
28-
label: "macOS x86_64 Intel (self-hosted)"
29-
- runner: ubuntu-latest
30-
label: "Ubuntu x86_64"
31-
- runner: windows-latest
32-
label: "Windows x86_64"
33-
- runner: macos-14
34-
label: "macOS ARM64 (Apple Silicon)"
35-
36-
steps:
37-
- name: Checkout
38-
uses: actions/checkout@v4
39-
with:
40-
ref: ${{ inputs.target_ref || github.ref }}
41-
42-
- name: Set up Python 3.11
43-
if: ${{ !contains(matrix.runner, 'self-hosted') }}
44-
uses: actions/setup-python@v5
45-
with:
46-
python-version: '3.11'
47-
48-
- name: Verify Architecture
49-
id: arch
50-
shell: bash
51-
run: |
52-
ARCH=$(uname -m)
53-
OS=$(uname -s)
54-
echo "Detected: $OS $ARCH"
55-
56-
- name: Build and Test (Self-Hosted Linux)
57-
if: contains(matrix.runner, 'self-hosted') && contains(matrix.runner, 'linux')
58-
shell: bash
59-
env:
60-
PYTHONUNBUFFERED: "1"
61-
run: |
62-
set -x
63-
64-
# 1. Find a Python to bootstrap (Conda or System)
65-
if [ -f "$HOME/miniconda3/envs/evocoder_env/bin/python3.11" ]; then
66-
BASE_PY="$HOME/miniconda3/envs/evocoder_env/bin/python3.11"
67-
echo "🔧 Bootstrapping from: $BASE_PY"
68-
elif command -v python3.11 >/dev/null 2>&1; then
69-
BASE_PY=python3.11
70-
else
71-
BASE_PY=python3
72-
fi
73-
74-
# 2. Create ISOLATED venv (Protects your lollama/tensorflow env)
75-
echo "🛡️ Creating fresh .venv..."
76-
rm -rf .venv
77-
$BASE_PY -m venv .venv
78-
79-
# 3. Activate venv
80-
source .venv/bin/activate
81-
82-
# 4. Install & Build INSIDE venv
83-
echo "🔥 Installing build tools..."
84-
python -m pip install --upgrade pip build
85-
86-
echo "📦 Building package..."
87-
python -m build
88-
89-
echo "💿 Installing package (Isolated)..."
90-
python -m pip install dist/*.whl
91-
92-
# 5. Test
93-
echo "🧪 Testing..."
94-
omnipkg --version
95-
omnipkg list
96-
97-
- name: Build and Test (Other Platforms)
98-
if: ${{ !(contains(matrix.runner, 'self-hosted') && contains(matrix.runner, 'linux')) }}
99-
shell: bash
100-
run: |
101-
if command -v python3 &>/dev/null; then PY=python3; else PY=python; fi
102-
if ! $PY -m venv .venv; then
103-
$PY -m venv .venv --without-pip
104-
curl -sS https://bootstrap.pypa.io/get-pip.py | .venv/bin/python
105-
fi
106-
if [ -f ".venv/bin/activate" ]; then source .venv/bin/activate; else source .venv/Scripts/activate; fi
107-
108-
python -m pip install --upgrade pip build
109-
python -m build
110-
pip install dist/*.whl
111-
omnipkg --version
112-
omnipkg list
113-
114-
# ═══════════════════════════════════════════════════════════════════
115-
# 2. CRITICAL TESTS (Podman) - FIXED: Use /var/tmp for all tests
116-
# ═══════════════════════════════════════════════════════════════════
117-
linux-distros-podman-critical:
1+
linux-distros-podman-critical:
1182
name: Podman - ${{ matrix.distro }} (${{ matrix.platform }})
1193
runs-on: [self-hosted, linux, x64]
1204
timeout-minutes: 25
@@ -144,27 +28,21 @@ jobs:
14428

14529
- name: Test
14630
run: |
147-
# Use /var/tmp for ALL Podman tests to avoid namespace/storage issues
148-
# This is more reliable than /tmp for rootless Podman with QEMU emulation
149-
SAFE_DISTRO="${{ matrix.distro }}"
150-
SAFE_DISTRO="${SAFE_DISTRO//:/}" # Remove colons
151-
SAFE_DISTRO="${SAFE_DISTRO//\//_}" # Remove slashes
152-
TEST_DIR="/var/tmp/omnipkg-test-${SAFE_DISTRO}-$$"
153-
154-
mkdir -p "$TEST_DIR"
155-
trap "rm -rf $TEST_DIR" EXIT
31+
# Use the workspace directly - no temp dir needed
32+
# GitHub Actions already provides an isolated workspace per job
33+
WORKSPACE_DIR="$(pwd)"
15634
157-
# Copy source to isolated test directory
158-
cp -r . "$TEST_DIR/"
35+
echo "Testing in workspace: $WORKSPACE_DIR"
15936
160-
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then SHELL="/bin/sh"; else SHELL="/bin/bash"; fi
37+
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then SHELL_CMD="/bin/sh"; else SHELL_CMD="/bin/bash"; fi
16138
162-
# Use standard rootless Podman with label=disable to avoid SELinux issues
39+
# Mount the current workspace directly
40+
# This avoids temp directory issues entirely
16341
podman run --rm \
16442
--security-opt label=disable \
165-
-v "$TEST_DIR:/workspace:rw" \
43+
-v "$WORKSPACE_DIR:/workspace:rw" \
16644
--platform ${{ matrix.platform }} \
167-
${{ matrix.distro }} $SHELL -c "
45+
${{ matrix.distro }} $SHELL_CMD -c "
16846
cd /workspace
16947
17048
# Install build dependencies based on distro
@@ -182,118 +60,3 @@ jobs:
18260
omnipkg --version
18361
omnipkg list
18462
"
185-
186-
# ═══════════════════════════════════════════════════════════════════
187-
# 3. DOCKER JOBS
188-
# ═══════════════════════════════════════════════════════════════════
189-
linux-distros-docker-debian:
190-
name: Docker - Debian/Ubuntu
191-
runs-on: ubuntu-latest
192-
strategy:
193-
fail-fast: false
194-
matrix:
195-
distro: [debian:12, debian:11, ubuntu:24.04, ubuntu:22.04, ubuntu:20.04]
196-
steps:
197-
- name: Checkout
198-
uses: actions/checkout@v4
199-
with:
200-
ref: ${{ inputs.target_ref || github.ref }}
201-
- name: Test
202-
run: |
203-
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c "
204-
cd /workspace
205-
apt-get update && apt-get install -y python3 python3-pip python3-venv build-essential python3-dev gcc
206-
python3 -m pip install --upgrade pip build || python3 -m pip install --break-system-packages pip build
207-
python3 -m build
208-
python3 -m pip install --break-system-packages dist/*.whl
209-
omnipkg --version
210-
omnipkg list
211-
"
212-
213-
linux-distros-docker-rhel:
214-
name: Docker - RHEL/Fedora
215-
runs-on: ubuntu-latest
216-
strategy:
217-
fail-fast: false
218-
matrix:
219-
distro: [fedora:39, fedora:38, rockylinux:9, rockylinux:8, almalinux:9]
220-
steps:
221-
- name: Checkout
222-
uses: actions/checkout@v4
223-
with:
224-
ref: ${{ inputs.target_ref || github.ref }}
225-
- name: Test
226-
run: |
227-
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c "
228-
cd /workspace
229-
if grep -q 'release 8' /etc/redhat-release; then
230-
dnf install -y python39 python39-pip gcc python3-devel && ln -sf /usr/bin/python3.9 /usr/bin/python3 && ln -sf /usr/bin/pip3.9 /usr/bin/pip3
231-
else
232-
dnf install -y python3 python3-pip gcc python3-devel
233-
fi
234-
python3 -m pip install --upgrade pip build
235-
python3 -m build
236-
python3 -m pip install dist/*.whl
237-
omnipkg --version
238-
omnipkg list
239-
"
240-
241-
linux-distros-docker-other:
242-
name: Docker - Arch/Alpine
243-
runs-on: ubuntu-latest
244-
strategy:
245-
fail-fast: false
246-
matrix:
247-
distro: [archlinux:latest, alpine:latest]
248-
steps:
249-
- name: Checkout
250-
uses: actions/checkout@v4
251-
with:
252-
ref: ${{ inputs.target_ref || github.ref }}
253-
- name: Test
254-
run: |
255-
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/sh -c "
256-
cd /workspace
257-
if command -v pacman &> /dev/null; then
258-
pacman -Sy --noconfirm python python-pip base-devel gcc
259-
elif command -v apk &> /dev/null; then
260-
apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers
261-
fi
262-
python3 -m pip install --break-system-packages --upgrade pip build
263-
python3 -m build
264-
python3 -m pip install --break-system-packages dist/*.whl
265-
omnipkg --version
266-
omnipkg list
267-
"
268-
269-
# ═══════════════════════════════════════════════════════════════════
270-
# 4. README STATS
271-
# ═══════════════════════════════════════════════════════════════════
272-
update-readme-stats:
273-
name: "📝 Update README Platform Stats"
274-
needs: [build-matrix, linux-distros-podman-critical, linux-distros-docker-debian, linux-distros-docker-rhel, linux-distros-docker-other]
275-
runs-on: ubuntu-latest
276-
if: success()
277-
continue-on-error: true
278-
steps:
279-
- name: Checkout
280-
uses: actions/checkout@v4
281-
with:
282-
fetch-depth: 0
283-
ref: ${{ inputs.target_ref || github.ref }}
284-
- name: Update Stats
285-
run: |
286-
sed -i "s/platforms-[0-9]*%20verified/platforms-22%20verified/" README.md
287-
if ! grep -q "macOS ARM64" README.md; then
288-
sed -i '/macOS Intel.*x86_64.*Intel/a | macOS ARM64 | ARM64 (Apple Silicon) | ✅ | Native installation |' README.md
289-
fi
290-
- name: Commit and Push
291-
run: |
292-
git config user.name "github-actions[bot]"
293-
git config user.email "github-actions[bot]@users.noreply.github.com"
294-
if ! git diff --quiet README.md; then
295-
git add README.md
296-
git commit -m "🤖 Auto-update: Platform verification stats [skip ci]"
297-
git pull --rebase origin main || echo "⚠️ Rebase conflict, overwriting..."
298-
git push || echo "⚠️ Push failed, ignoring."
299-
fi

0 commit comments

Comments
 (0)