From 3e29d5cdbd618571dff408bf34abffff9d8519dd Mon Sep 17 00:00:00 2001 From: Adrian Stanea Date: Tue, 21 Nov 2023 15:36:25 +0200 Subject: [PATCH] ci: testing github actions - disable other azure pipelines builds. - remove the attempt to build in azure pipelines steps the wheels - NOTE: cant build on centOS7 with usb backed since packages are not available. Try with newer docker image - Enable log in libm2k linux build Signed-off-by: Adrian Stanea --- .github/scripts/install_deps.sh | 22 +++++++++++++++++++--- .github/workflows/build_wheels.yml | 19 ++++++++++++------- CI/ubuntu/make_linux | 4 ++-- azure-pipelines.yml | 23 ----------------------- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh index c030e62a..21a38460 100755 --- a/.github/scripts/install_deps.sh +++ b/.github/scripts/install_deps.sh @@ -4,9 +4,24 @@ LIBIIO_VERSION=libiio-v0 PACKAGE_DIR=${1-build} echo $PACKAGE_DIR -apt-get -qq update -apt-get install -y git wget tar graphviz libavahi-common-dev libavahi-client-dev libaio-dev libusb-1.0-0-dev libxml2-dev rpm tar bzip2 gzip flex bison git swig python3 python3-dev python3-setuptools python3-pip python3-all libserialport-dev +echo "Calling update - SKIPPED" +# yum -y update +# apt-get -y update +echo "Installing dependencies" +# On CentOS 8, avahi-devel & doxygen are in this repo; enable it +yum -y install yum-utils +yum config-manager --set-enabled powertools +yum -y install libxml2-devel libusb1-devel doxygen libaio-devel \ + avahi-devel bzip2 gzip rpm rpm-build swig + +# apt-get install -y git wget tar graphviz libavahi-common-dev libavahi-client-dev libaio-dev libusb-1.0-0-dev libxml2-dev rpm tar bzip2 gzip flex bison git swig python3 python3-dev python3-setuptools python3-pip python3-all libserialport-dev + +# THE below deps work on centOS7 without USB backend +# yum install -y git wget tar graphviz avahi-devel avahi-tools libaio-devel libusbx-devel libusb1-devel libxml2-devel bzip2 gzip flex bison git swig python3 python3-devel python3-setuptools python3-pip # libserialport-dev +yum install -y git wget tar graphviz avahi-devel avahi-tools libaio-devel libusb1-devel libxml2-devel rpm tar bzip2 gzip flex bison git swig python3 python3-devel python3-setuptools python3-pip libserialport rpm-build + +echo "Installing cmake with pip" python3 -m pip install cmake cmake --version @@ -14,7 +29,8 @@ git clone -b $LIBIIO_VERSION --single-branch --depth 1 https://github.com/analog cd libiio mkdir -p build cd build -cmake -DHAVE_DNS_SD=OFF .. +# CentOS 7 does not have new enough kernel headers to support modern libusb. nor libserialport +cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DPYTHON_BINDINGS=ON -DWITH_USB_BACKEND=ON -DWITH_IIOD_USBD=ON make make install cd ../.. diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 413b077e..0ac51a07 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,6 +2,8 @@ name: Build on: [push, pull_request] +# TODO: add a simple test that tries to import the libm2k package after creating wheel; +# NOTE: do i have a acces to a pip install during the cybuildwheel process? jobs: build_wheels: name: Build wheels on ${{ matrix.os }} @@ -9,11 +11,12 @@ jobs: strategy: matrix: os: [ubuntu-22.04] + # os: [CentOS_7] # manylinux2014: (CentOS 7 based) python_version: ['3.11'] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 name: Install Python ${{ matrix.python_version }} with: python-version: ${{ matrix.python_version }} @@ -22,23 +25,25 @@ jobs: run: | mkdir ${{ github.workspace }}/build touch ${{ github.workspace }}/build/setup.py + # TODO: Test using more recent Docker image - name: Get some sample wheels run: | python -m pip install cibuildwheel twine cibuildwheel --output-dir ${{ github.workspace }}/wheelhouse ${{ github.workspace }}/build env: - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 - CIBW_MANYLINUX_I686_IMAGE: manylinux_2_24 - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_24 + CIBW_DEBUG_KEEP_CONTAINER=: TRUE + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_I686_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 # Skip building PyPy wheels on all platforms # Skip musllinux builds CIBW_SKIP: "pp* *-musllinux*" - CIBW_BUILD_VERBOSITY: 1 + CIBW_BUILD_VERBOSITY: 3 CIBW_BEFORE_ALL: > cd {project} && ./.github/scripts/install_deps.sh {package} CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*" CIBW_ENVIRONMENT: COMPILE_BINDINGS="True" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: manylinux_wheels path: ${{ github.workspace }}/wheelhouse diff --git a/CI/ubuntu/make_linux b/CI/ubuntu/make_linux index fa7e27b6..f5daf76e 100755 --- a/CI/ubuntu/make_linux +++ b/CI/ubuntu/make_linux @@ -9,7 +9,7 @@ handle_default() { cd build #create deb for bindings - cmake -DENABLE_PYTHON=ON -DENABLE_TOOLS=ON -DENABLE_CSHARP=OFF -DENABLE_LOG=OFF -DBUILD_EXAMPLES=ON .. && make + cmake -DENABLE_PYTHON=ON -DENABLE_TOOLS=ON -DENABLE_CSHARP=OFF -DENABLE_LOG=ON -DBUILD_EXAMPLES=ON .. && make sudo python3 setup.py --command-packages=stdeb.command sdist_dsc cd "$(find . -type d -name "debian" | head -n 1)" sudo env DEB_BUILD_OPTIONS=nocheck debuild -us -uc @@ -20,7 +20,7 @@ handle_default() { ls #create simple .deb without Python bindings - cmake -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON -DENABLE_PYTHON=OFF -DENABLE_CSHARP=ON -DENABLE_TOOLS=ON -DENABLE_LOG=OFF -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_EXAMPLES=ON .. + cmake -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON -DENABLE_PYTHON=OFF -DENABLE_CSHARP=ON -DENABLE_TOOLS=ON -DENABLE_LOG=ON -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_EXAMPLES=ON .. make && make package ls } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ced5c08..7b29dcc4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,29 +68,6 @@ jobs: targetFolder: '$(Build.ArtifactStagingDirectory)' - script: ./CI/ubuntu/make_linux displayName: "Build" - - ${{ each pyVersion in parameters.pythonVersions }}: - - task: UsePythonVersion@0 - condition: and(ne(variables['System.JobName'], 'deploy_doxygen'), eq('${{ pyVersion }}', '3.11')) - displayName: Use Python ${{ pyVersion }} - inputs: - versionSpec: '${{ pyVersion }}' - - script: | - python3 --version - python3 -m pip install wheel twine build virtualenv - cd '$(Agent.BuildDirectory)/s/build/' - mkdir -p wheelhouse - export COMPILE_BINDINGS=True - python3 -m build - export COMPILE_BINDINGS= - cp dist/*.whl wheelhouse - displayName: Wheel Python ${{ pyVersion }} - condition: and(ne(variables['System.JobName'], 'deploy_doxygen'), eq('${{ pyVersion }}', '3.11')) - - task: CopyFiles@2 - condition: ne(variables['System.JobName'], 'deploy_doxygen') - inputs: - sourceFolder: '$(Agent.BuildDirectory)/s/build/' - contents: '$(Agent.BuildDirectory)/s/build/wheelhouse/?(*.whl)' - targetFolder: '$(Build.ArtifactStagingDirectory)' - task: CopyFiles@2 condition: ne(variables['System.JobName'], 'deploy_doxygen') inputs: