# --------------------------------------------------------------------------- # AMD-SMI manylinux Python wheel build. # # Builds portable AMD-SMI Python wheels (manylinux_2_28, RPM + Debian) and # smoke-tests the import. # # Unlike TheRock CI, which builds native rpm/deb packages, this produces # pip-installable wheels. No GPU required. # --------------------------------------------------------------------------- name: AMDSMI Manylinux Wheels on: pull_request: branches: [develop] paths: - 'projects/amdsmi/**' - '!projects/amdsmi/docs/**' - '!projects/amdsmi/**/*.md' - '!projects/amdsmi/**/*.rst' - '.github/workflows/amdsmi-manylinux-build.yml' push: branches: [develop] paths: - 'projects/amdsmi/**' - '!projects/amdsmi/docs/**' - '!projects/amdsmi/**/*.md' - '!projects/amdsmi/**/*.rst' - '.github/workflows/amdsmi-manylinux-build.yml' workflow_dispatch: permissions: contents: read jobs: build-amdsmi-wheels: name: ${{matrix.target.name}} runs-on: ${{matrix.target.runs-on}} container: ${{matrix.target.container}} strategy: fail-fast: false matrix: target: - id: rpm name: Build RPM Wheels (AlmaLinux 8 / manylinux_2_28) runs-on: ubuntu-22.04 container: quay.io/pypa/manylinux_2_28_x86_64 python-bin: /opt/python/cp310-cp310/bin/python3 os-variant: AlmaLinux8 repair-flag: '--repair' artifact-prefix: amdsmi-rpm-wheels - id: debian name: Build Debian Wheels (Ubuntu 22.04) runs-on: ubuntu-22.04 container: '' python-bin: python3 os-variant: Ubuntu22 repair-flag: '' artifact-prefix: amdsmi-debian-wheels steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Install Debian build prerequisites if: matrix.target.id == 'debian' run: | sudo apt-get update sudo apt-get install -y git make gcc g++ cmake ninja-build libssl-dev libdrm-dev \ libnl-3-dev libnl-genl-3-dev libmnl-dev - name: Install RPM build prerequisites if: matrix.target.id == 'rpm' run: | dnf install -y libnl3-devel libmnl-devel - name: Mark workspace safe for git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Build wheels run: | ${{matrix.target.python-bin}} \ "$GITHUB_WORKSPACE/projects/amdsmi/tools/build_wheel.py" \ --project-dir "$GITHUB_WORKSPACE/projects/amdsmi" \ --output-dir "$GITHUB_WORKSPACE/wheels" \ --os-variant ${{matrix.target.os-variant}} \ ${{matrix.target.repair-flag}} - name: Verify wheels exist run: | ls -al "$GITHUB_WORKSPACE/wheels" if ! ls "$GITHUB_WORKSPACE"/wheels/*.whl >/dev/null 2>&1; then echo "No wheels found; failing." exit 1 fi - name: Smoke test (install + import) run: | ${{matrix.target.python-bin}} -m pip install --upgrade pip ${{matrix.target.python-bin}} -m pip install "$GITHUB_WORKSPACE"/wheels/*.whl ${{matrix.target.python-bin}} -c "import amdsmi; print('amdsmi import OK')" - name: Upload wheels (by SHA) uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: ${{matrix.target.artifact-prefix}}-${{github.sha}} path: ${{github.workspace}}/wheels/*.whl if-no-files-found: error retention-days: 30 - name: Upload wheels (downloadable) uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: ${{matrix.target.artifact-prefix}} path: ${{github.workspace}}/wheels/*.whl if-no-files-found: warn retention-days: 90