WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

llvmlite_linux-64_wheel_builder #151

llvmlite_linux-64_wheel_builder

llvmlite_linux-64_wheel_builder #151

name: llvmlite_linux-64_wheel_builder
on:
pull_request:
paths:
- .github/workflows/llvmlite_linux-64_wheel_builder.yml
workflow_dispatch:
inputs:
llvmdev_run_id:
description: 'llvmdev workflow run ID (optional)'
required: false
type: string
upload_wheel_to_anaconda:
description: 'Upload wheel to Anaconda Cloud - numba channel'
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
FALLBACK_LLVMDEV_VERSION: "20"
CONDA_CHANNEL_NUMBA: numba/label/llvm20-wheel
VALIDATION_PYTHON_VERSION: "3.12"
ARTIFACT_RETENTION_DAYS: 7
MANYLINUX_IMAGE: "manylinux2014_x86_64"
jobs:
linux-64-build:
name: linux-64-build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -elx {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Download llvmdev Artifact
if: ${{ inputs.llvmdev_run_id != '' }}
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: llvmdev_for_wheel_linux-64
path: llvmdev_conda_packages
run-id: ${{ inputs.llvmdev_run_id }}
repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Map Python version
run: |
# Map Python version to manylinux path
case "${{ matrix.python-version }}" in
"3.10") echo "PYTHON_PATH=cp310-cp310" >> "$GITHUB_ENV" ;;
"3.11") echo "PYTHON_PATH=cp311-cp311" >> "$GITHUB_ENV" ;;
"3.12") echo "PYTHON_PATH=cp312-cp312" >> "$GITHUB_ENV" ;;
"3.13") echo "PYTHON_PATH=cp313-cp313" >> "$GITHUB_ENV" ;;
"3.14") echo "PYTHON_PATH=cp314-cp314" >> "$GITHUB_ENV" ;;
*) echo "Invalid Python version" && exit 1 ;;
esac
# Define Miniconda installer URL
echo "MINICONDA_FILE=https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh" >> "$GITHUB_ENV"
- name: Build wheel in manylinux container
run: |
LLVMDEV_ARTIFACT_PATH="/root/llvmlite/llvmdev_conda_packages"
# Run the build script in manylinux container using the existing script
docker run --rm \
-v "$(pwd):/root/llvmlite" \
quay.io/pypa/${{ env.MANYLINUX_IMAGE }} \
bash -c "git config --global --add safe.directory /root/llvmlite && /root/llvmlite/buildscripts/manylinux/build_llvmlite.sh ${{ env.MINICONDA_FILE }} ${{ env.PYTHON_PATH }} $LLVMDEV_ARTIFACT_PATH"
# Create wheelhouse directory for artifact upload
mkdir -p wheelhouse
# The script creates output in a specific location based on architecture and Python version
WHEEL_DIR="docker_output/dist_x86_64_${{ env.PYTHON_PATH }}/wheelhouse"
# List wheels to debug
echo "Available wheels in $WHEEL_DIR:"
find "$WHEEL_DIR" -type f -name "*.whl" -print
# Copy wheels to upload directory
cp "$WHEEL_DIR"/*.whl wheelhouse/ || echo "Warning: No matching wheel found!"
# Verify we have the correct wheel
echo "--- Final wheel for upload: ---"
find wheelhouse -type f -name "*.whl" -print
- name: Upload wheel
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: llvmlite-linux-64-py${{ matrix.python-version }}
path: wheelhouse/*.whl
compression-level: 0
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error
- name: Show Workflow Run ID
run: "echo \"Workflow Run ID: ${{ github.run_id }}\""
linux-64-validate:
name: linux-64-validate
needs: linux-64-build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -elx {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
python-version: ${{ env.VALIDATION_PYTHON_VERSION }}
auto-update-conda: true
auto-activate-base: true
activate-environment: true
- name: Install validation dependencies
run: conda install -c defaults wheel twine keyring rfc3986
- name: Download llvmlite wheels
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: llvmlite-linux-64-py${{ matrix.python-version }}
path: dist
- name: Validate wheels
run: |
cd dist
for WHL_FILE in *.whl; do
echo "=== Validating $WHL_FILE ==="
# Check wheel structure
twine check "$WHL_FILE"
done
linux-64-test:
name: linux-64-test
needs: linux-64-build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -elx {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- name: Setup Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Download llvmlite wheel
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: llvmlite-linux-64-py${{ matrix.python-version }}
path: dist
- name: Install and test
env:
LLVMLITE_DIST_TEST: "1"
run: |
# Get the Python executable path
PYTHON_PATH=$(which python)
# Upgrade pip and install wheel
"${PYTHON_PATH}" -m pip install --upgrade pip wheel
# Install wheel
cd dist
# Look for wheel matching this python version
PY_TAG=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')")
# Use find instead of ls for better handling of non-alphanumeric filenames
whl=$(find . -type f -name "*${PY_TAG}*.whl" | sort | head -n 1)
if [ -z "$whl" ]; then
echo "ERROR: No matching wheel found for Python ${{ matrix.python-version }} (tag: $PY_TAG)"
find . -type f -name "*.whl" -print
exit 1
fi
echo "Installing lief for distribution testing"
"${PYTHON_PATH}" -m pip install -v lief
echo "Using wheel: $whl"
"${PYTHON_PATH}" -m pip install -v "$whl"
# Run tests
"${PYTHON_PATH}" -m llvmlite.tests
linux-64-upload:
name: linux-64-upload
needs: [linux-64-test, linux-64-validate]
if: github.event_name == 'workflow_dispatch' && inputs.upload_wheel_to_anaconda
runs-on: ubuntu-latest
defaults:
run:
shell: bash -elx {0}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
python-version: ${{ env.VALIDATION_PYTHON_VERSION }}
auto-update-conda: true
auto-activate-base: true
activate-environment: true
- name: Install anaconda-client
run: conda install -c anaconda anaconda-client
- name: Download llvmlite wheel
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: llvmlite-linux-64-py${{ matrix.python-version }}
path: dist
- name: Upload wheel to Anaconda Cloud
env:
ANACONDA_API_TOKEN: ${{ secrets.NUMBA_CHANNEL_WHEEL_UPLOAD }}
run: |
cd dist
# Find appropriate wheel for Python version
PY_TAG="cp$(echo "${{ matrix.python-version }}" | tr -d '.')"
# Use find instead of ls for better handling of non-alphanumeric filenames
whl=$(find . -type f -name "*${PY_TAG}*.whl" | sort | head -n 1)
if [ -z "$whl" ]; then
echo "ERROR: No matching wheel found for Python ${{ matrix.python-version }}"
find . -type f -name "*.whl" -print
exit 1
fi
echo "Uploading wheel: $whl"
anaconda -t "$ANACONDA_API_TOKEN" upload --force -u numba -l dev "$whl"