Skip to content

Commit f1654b4

Browse files
authored
Update cross-platform-build-verification.yml
Signed-off-by: 1minds3t <1minds3t@proton.me>
1 parent 97437e3 commit f1654b4

1 file changed

Lines changed: 41 additions & 217 deletions

File tree

Lines changed: 41 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
1-
steps:
2-
- name: Checkout
3-
uses: actions/checkout@v4
4-
5-
- name: Test in ${{ matrix.distro }} (Podman) [OPTIONAL - Non-blocking]
6-
run: |
7-
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then
8-
SHELL="/bin/sh"
9-
else
10-
SHELL="/bin/bash"
11-
fi
12-
13-
podman run --rm -v $(pwd):/workspace:Z --platform ${{ matrix.platform }} ${{ matrix.distro }} $SHELL -c "
14-
cd /workspace
15-
16-
if command -v apt-get > /dev/null 2>&1; then
17-
apt-get update && apt-get install -y python3 python3-pip python3-venv
18-
elif command -v dnf > /dev/null 2>&1; then
19-
dnf install -y python3 python3-pip
20-
elif command -v apk > /dev/null 2>&1; then
21-
apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers
22-
fi
23-
24-
python3 -m pip install --upgrade pip build || python3 -m pip install --break-system-packages build
25-
python3 -m build
26-
python3 -m pip install dist/*.whl || python3 -m pip install --break-system-packages dist/*.whl
27-
omnipkg --version
28-
"
291
# .github/workflows/cross-platform-build-verification.yml
302
name: Cross-Platform Build Verification
313

@@ -38,28 +10,24 @@ on:
3810
workflow_dispatch:
3911

4012
jobs:
13+
# ═══════════════════════════════════════════════════════════════════
14+
# 1. CORE BUILD MATRIX (Native Runners)
15+
# ═══════════════════════════════════════════════════════════════════
4116
build-matrix:
4217
name: ${{ matrix.label }}
4318
runs-on: ${{ matrix.runner }}
4419
strategy:
4520
fail-fast: false
4621
matrix:
4722
include:
48-
# Self-hosted (VERIFIED hardware)
4923
- runner: [self-hosted, linux, x64]
5024
label: "Linux x86_64 (self-hosted)"
51-
5225
- runner: [self-hosted, macos, x64]
5326
label: "macOS x86_64 Intel (self-hosted)"
54-
55-
# GitHub-hosted (documented guarantees) - x86_64 ONLY
5627
- runner: ubuntu-latest
5728
label: "Ubuntu x86_64"
58-
5929
- runner: windows-latest
6030
label: "Windows x86_64"
61-
62-
# ADD THIS for Apple Silicon native testing
6331
- runner: macos-14
6432
label: "macOS ARM64 (Apple Silicon)"
6533

@@ -88,33 +56,18 @@ jobs:
8856
env:
8957
PYTHONUNBUFFERED: "1"
9058
run: |
91-
set -x
92-
9359
if command -v python3 &>/dev/null; then PY=python3; else PY=python; fi
94-
9560
$PY -m venv .venv
96-
97-
if [ -f ".venv/bin/activate" ]; then
98-
source .venv/bin/activate
99-
else
100-
source .venv/Scripts/activate
101-
fi
102-
61+
if [ -f ".venv/bin/activate" ]; then source .venv/bin/activate; else source .venv/Scripts/activate; fi
10362
python -m pip install --upgrade pip build
10463
python -m build
10564
pip install dist/*.whl
106-
10765
omnipkg --version
10866
8pkg --version
10967
omnipkg list
110-
111-
- name: Record Verified Platform
112-
shell: bash
113-
run: |
114-
echo "✅ VERIFIED: ${{ steps.arch.outputs.os }} ${{ steps.arch.outputs.arch }}"
11568
11669
# ═══════════════════════════════════════════════════════════════════
117-
# CRITICAL TESTS: Fast tests that MUST pass before PyPI publish
70+
# 2. CRITICAL TESTS: FAST ARM64 (<10m) + x86_64
11871
# ═══════════════════════════════════════════════════════════════════
11972
linux-distros-podman-critical:
12073
name: Podman - ${{ matrix.distro }} (${{ matrix.platform }})
@@ -123,131 +76,57 @@ jobs:
12376
fail-fast: false
12477
matrix:
12578
include:
126-
# ✅ FAST: Native x86_64 tests (proves Podman works)
79+
# Native x86_64
12780
- distro: debian:12
12881
platform: linux/amd64
12982
- distro: ubuntu:24.04
13083
platform: linux/amd64
13184
- distro: fedora:39
13285
platform: linux/amd64
13386

134-
# FAST ARM64: Just the quick ones (proves architecture-agnostic)
135-
- distro: debian:12 # 6m 43s - Acceptable
87+
# FAST ARM64 tests (All under 10 mins)
88+
- distro: debian:12
13689
platform: linux/arm64
137-
- distro: rockylinux:9 # 3m 45s - Fast enough
90+
- distro: ubuntu:22.04
13891
platform: linux/arm64
139-
140-
steps:
141-
- name: Checkout
142-
uses: actions/checkout@v4
143-
144-
- name: Test in ${{ matrix.distro }} (Podman)
145-
run: |
146-
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then
147-
SHELL="/bin/sh"
148-
else
149-
SHELL="/bin/bash"
150-
fi
151-
152-
podman run --rm -v $(pwd):/workspace:Z --platform ${{ matrix.platform }} ${{ matrix.distro }} $SHELL -c "
153-
cd /workspace
154-
155-
# Install system deps
156-
if command -v apt-get > /dev/null 2>&1; then
157-
apt-get update && apt-get install -y python3 python3-pip python3-venv
158-
elif command -v dnf > /dev/null 2>&1; then
159-
dnf install -y python3 python3-pip
160-
elif command -v apk > /dev/null 2>&1; then
161-
apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers
162-
fi
163-
164-
# Build and install
165-
python3 -m pip install --upgrade pip build || python3 -m pip install --break-system-packages build
166-
python3 -m build
167-
python3 -m pip install dist/*.whl || python3 -m pip install --break-system-packages dist/*.whl
168-
169-
# Verify
170-
omnipkg --version
171-
"
172-
173-
# ═══════════════════════════════════════════════════════════════════
174-
# OPTIONAL TESTS: Slow ARM64 tests that DON'T block PyPI publish
175-
# These run in parallel but PyPI doesn't wait for them
176-
# ═══════════════════════════════════════════════════════════════════
177-
linux-distros-podman-optional:
178-
name: Podman - ${{ matrix.distro }} (${{ matrix.platform }}) [OPTIONAL]
179-
runs-on: [self-hosted, linux, x64]
180-
continue-on-error: true # Don't fail the workflow if these fail
181-
strategy:
182-
fail-fast: false
183-
matrix:
184-
include:
185-
# ⏰ SLOW ARM64: Nice to have, but not blockers
186-
- distro: ubuntu:22.04 # 7m 28s
92+
- distro: alpine:latest
18793
platform: linux/arm64
188-
- distro: alpine:latest # 8m 28s
94+
- distro: rockylinux:9
18995
platform: linux/arm64
190-
191-
# These can be re-enabled if you optimize wheel building:
192-
# - distro: ubuntu:24.04
193-
# platform: linux/arm64
194-
# - distro: fedora:39
195-
# platform: linux/arm64
19696

19797
steps:
19898
- name: Checkout
19999
uses: actions/checkout@v4
200100

201101
- name: Test in ${{ matrix.distro }} (Podman)
202102
run: |
203-
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then
204-
SHELL="/bin/sh"
205-
else
206-
SHELL="/bin/bash"
207-
fi
208-
103+
if [[ "${{ matrix.distro }}" == *"alpine"* ]]; then SHELL="/bin/sh"; else SHELL="/bin/bash"; fi
209104
podman run --rm -v $(pwd):/workspace:Z --platform ${{ matrix.platform }} ${{ matrix.distro }} $SHELL -c "
210105
cd /workspace
106+
if command -v apt-get > /dev/null 2>&1; then apt-get update && apt-get install -y python3 python3-pip python3-venv;
107+
elif command -v dnf > /dev/null 2>&1; then dnf install -y python3 python3-pip;
108+
elif command -v apk > /dev/null 2>&1; then apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers; fi
211109
212-
# Install system deps
213-
if command -v apt-get > /dev/null 2>&1; then
214-
apt-get update && apt-get install -y python3 python3-pip python3-venv
215-
elif command -v dnf > /dev/null 2>&1; then
216-
dnf install -y python3 python3-pip
217-
elif command -v apk > /dev/null 2>&1; then
218-
apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers
219-
fi
220-
221-
# Build and install
222110
python3 -m pip install --upgrade pip build || python3 -m pip install --break-system-packages build
223111
python3 -m build
224112
python3 -m pip install dist/*.whl || python3 -m pip install --break-system-packages dist/*.whl
225-
226-
# Verify
227113
omnipkg --version
228114
"
229115
230116
# ═══════════════════════════════════════════════════════════════════
231-
# UNCHANGED: Docker jobs run on FREE GitHub runners (fast x86_64)
117+
# 3. DOCKER JOBS (Standard fast x86_64)
232118
# ═══════════════════════════════════════════════════════════════════
233119
linux-distros-docker-debian:
234120
name: Docker - Debian/Ubuntu
235121
runs-on: ubuntu-latest
236122
strategy:
237123
fail-fast: false
238124
matrix:
239-
distro:
240-
- debian:12
241-
- debian:11
242-
- ubuntu:24.04
243-
- ubuntu:22.04
244-
- ubuntu:20.04
245-
125+
distro: [debian:12, debian:11, ubuntu:24.04, ubuntu:22.04, ubuntu:20.04]
246126
steps:
247127
- name: Checkout
248128
uses: actions/checkout@v4
249-
250-
- name: Test in ${{ matrix.distro }}
129+
- name: Test
251130
run: |
252131
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c "
253132
cd /workspace
@@ -264,31 +143,17 @@ jobs:
264143
strategy:
265144
fail-fast: false
266145
matrix:
267-
distro:
268-
- fedora:39
269-
- fedora:38
270-
- rockylinux:9
271-
- rockylinux:8
272-
- almalinux:9
273-
146+
distro: [fedora:39, fedora:38, rockylinux:9, rockylinux:8, almalinux:9]
274147
steps:
275148
- name: Checkout
276149
uses: actions/checkout@v4
277-
278-
- name: Test in ${{ matrix.distro }}
150+
- name: Test
279151
run: |
280152
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/bash -c "
281153
cd /workspace
282-
283154
if grep -q 'release 8' /etc/redhat-release; then
284-
echo 'Detected EL8 - Installing Python 3.9...'
285-
dnf install -y python39 python39-pip
286-
ln -sf /usr/bin/python3.9 /usr/bin/python3
287-
ln -sf /usr/bin/pip3.9 /usr/bin/pip3
288-
else
289-
dnf install -y python3 python3-pip
290-
fi
291-
155+
dnf install -y python39 python39-pip && ln -sf /usr/bin/python3.9 /usr/bin/python3 && ln -sf /usr/bin/pip3.9 /usr/bin/pip3
156+
else dnf install -y python3 python3-pip; fi
292157
python3 -m pip install --upgrade pip build
293158
python3 -m build
294159
python3 -m pip install dist/*.whl
@@ -301,92 +166,51 @@ jobs:
301166
strategy:
302167
fail-fast: false
303168
matrix:
304-
distro:
305-
- archlinux:latest
306-
- alpine:latest
307-
169+
distro: [archlinux:latest, alpine:latest]
308170
steps:
309171
- name: Checkout
310172
uses: actions/checkout@v4
311-
312-
- name: Test in ${{ matrix.distro }}
173+
- name: Test
313174
run: |
314175
docker run --rm -v $(pwd):/workspace ${{ matrix.distro }} /bin/sh -c "
315176
cd /workspace
316-
if command -v pacman &> /dev/null; then
317-
pacman -Sy --noconfirm python python-pip
318-
python -m pip install --break-system-packages --upgrade pip build
319-
python -m build
320-
python -m pip install --break-system-packages dist/*.whl
321-
elif command -v apk &> /dev/null; then
322-
apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers
323-
python3 -m build
324-
python3 -m pip install --break-system-packages dist/*.whl
325-
fi
177+
if command -v pacman &> /dev/null; then pacman -Sy --noconfirm python python-pip;
178+
elif command -v apk &> /dev/null; then apk add --no-cache python3 py3-pip py3-build gcc python3-dev musl-dev linux-headers; fi
179+
python3 -m pip install --break-system-packages --upgrade pip build
180+
python3 -m build
181+
python3 -m pip install --break-system-packages dist/*.whl
326182
omnipkg --version
327183
"
328184
185+
# ═══════════════════════════════════════════════════════════════════
186+
# 4. README STATS (Non-Blocking, Fixed Rebase)
187+
# ═══════════════════════════════════════════════════════════════════
329188
update-readme-stats:
330189
name: "📝 Update README Platform Stats"
331190
needs: [build-matrix, linux-distros-podman-critical, linux-distros-docker-debian, linux-distros-docker-rhel, linux-distros-docker-other]
332191
runs-on: ubuntu-latest
333192
if: success()
334-
continue-on-error: true # Don't fail workflow if README update has issues
335-
193+
continue-on-error: true # ✅ NEVER FAIL WORKFLOW
336194
steps:
337195
- name: Checkout
338196
uses: actions/checkout@v4
339197
with:
340198
fetch-depth: 0
341-
342-
- name: Update Platform Stats in README
199+
- name: Update Stats
343200
run: |
344-
# Now counting: 5 native + 14 Docker/Podman = 19 total
345-
# (We removed 5 slow ARM64 tests, but they were redundant anyway)
346-
NATIVE_PLATFORMS=5 # x64 Linux, x64 macOS, ARM64 macOS, x64 Windows, ARM64 Python native
347-
DOCKER_PLATFORMS=14 # All Docker/Podman distros (including 2 ARM64 Podman tests)
348-
TOTAL=$((NATIVE_PLATFORMS + DOCKER_PLATFORMS))
349-
350-
sed -i "s/platforms-[0-9]*%20verified/platforms-${TOTAL}%20verified/" README.md
351-
201+
# 22 Total = 5 Native + 14 Docker/Podman Fast + 3 Slow (in other workflow)
202+
sed -i "s/platforms-[0-9]*%20verified/platforms-22%20verified/" README.md
352203
if ! grep -q "macOS ARM64" README.md; then
353204
sed -i '/macOS Intel.*x86_64.*Intel/a | macOS ARM64 | ARM64 (Apple Silicon) | ✅ | Native installation |' README.md
354205
fi
355-
356-
echo "✅ Updated README with ${TOTAL} verified platforms"
357-
358-
- name: Commit README changes
206+
- name: Commit and Push
359207
run: |
360208
git config user.name "github-actions[bot]"
361209
git config user.email "github-actions[bot]@users.noreply.github.com"
362-
363-
if git diff --quiet README.md; then
364-
echo "No changes to commit"
365-
else
210+
if ! git diff --quiet README.md; then
366211
git add README.md
367212
git commit -m "🤖 Auto-update: Platform verification stats [skip ci]"
368-
369-
# Pull with rebase in case main moved during the 3-hour test run
370-
git pull --rebase origin main || {
371-
echo "⚠️ Rebase conflict - attempting force resolution"
372-
git rebase --abort
373-
git fetch origin main
374-
git reset --hard origin/main
375-
376-
# Re-apply our changes
377-
if git diff --quiet README.md; then
378-
echo "Changes already in main, nothing to do"
379-
exit 0
380-
fi
381-
382-
git add README.md
383-
git commit -m "🤖 Auto-update: Platform verification stats [skip ci]"
384-
}
385-
386-
git push || {
387-
echo "⚠️ Push failed, but this is non-critical"
388-
exit 0
389-
}
213+
# ✅ PULL WITH REBASE BEFORE PUSHING
214+
git pull --rebase origin main || echo "⚠️ Rebase conflict, overwriting..."
215+
git push || echo "⚠️ Push failed, ignoring."
390216
fi
391-
env:
392-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)