From bc82570d452fb267dd464a93987454a8264d7e06 Mon Sep 17 00:00:00 2001 From: Andreea Andrisan Date: Tue, 16 Apr 2024 12:14:53 +0300 Subject: [PATCH 1/2] azure-pipelines.yml: add extra builds for macos system Signed-off-by: Andreea Andrisan (cherry picked from commit a763a8dbb2f5bcee4df584c4013278c516d9df5a) --- azure-pipelines.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7a043b6..4025843 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -183,16 +183,35 @@ jobs: artifactName: '$(artifactName)' - job: macOSBuilds + workspace: + clean: all strategy: matrix: macOS_11: - imageName: 'macOS-11' + poolName: 'Azure Pipelines' + vmImage: 'macOS-11' + agentName: 'Azure Pipelines 4' artifactName: 'macOS-11' macOS_12: - imageName: 'macOS-12' + poolName: 'Azure Pipelines' + vmImage: 'macOS-12' + agentName: 'Azure Pipelines 3' artifactName: 'macOS-12' + macOS_13_x64: + poolName: 'Azure Pipelines' + vmImage: 'macOS-13' + agentName: 'Azure Pipelines 2' + artifactName: 'macOS-13-x64' + macOS_13_arm64: + poolName: 'Default' + vmImage: + agentName: 'miniMAC_arm64' + artifactName: 'macOS-13-arm64' pool: - vmImage: $(imageName) + name: $(poolName) + vmImage: $(vmImage) + demands: + - agent.name -equals $(agentName) variables: PACKAGE_TO_INSTALL: 'build/*.pkg' steps: From 9b59d77b7508315aecc22f3d2e8408a84a3a0812 Mon Sep 17 00:00:00 2001 From: Andreea Andrisan Date: Tue, 16 Apr 2024 12:24:48 +0300 Subject: [PATCH 2/2] azure-pipelines.yml: add new builds for Linux system Signed-off-by: Andreea Andrisan (cherry picked from commit 1a0c37037759eaa38a3b366204bdda9e90493ee6) --- CI/travis/ci-linux.sh | 41 +++++++++++++++++++++++++++++ azure-pipelines.yml | 60 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 92 insertions(+), 9 deletions(-) create mode 100644 CI/travis/ci-linux.sh diff --git a/CI/travis/ci-linux.sh b/CI/travis/ci-linux.sh new file mode 100644 index 0000000..d2866a0 --- /dev/null +++ b/CI/travis/ci-linux.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -x + +handle_centos() { + local package=$1 + yum -y install yum-utils gcc + yum config-manager --set-enabled powertools + yum localinstall -y $package + export CMAKE_OPTIONS="-DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON .." + export LD_LIBRARY_PATH=/usr/local/lib64/ +} + +handle_default() { + local package=$1 + DEBIAN_FRONTEND=noninteractive apt-get install -y rpm + sudo dpkg -i $package + export CMAKE_OPTIONS="-DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON .." +} + +handle_opensuse() { + local package=$1 + zypper in -y --allow-unsigned-rpm $package + export CMAKE_OPTIONS="-DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON .." +} + +handle_"$1" "$2" + +python3 -m pip install pylibiio --no-binary :all: +# Build project +mkdir -p build +cd build +cmake $CMAKE_OPTIONS +sudo make && sudo make package && make test +sudo make install +ldconfig +cd .. +cd bindings/python +pip install -r requirements_dev.txt +python3 -m pip install pytest +python3 -m pytest -vs --skip-scan diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4025843..7b640f8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,22 +33,64 @@ pr: jobs: - job: LinuxBuilds + pool: + vmImage: 'ubuntu-latest' strategy: matrix: + ubuntu_18_04_x86_64: + image: 'tfcollins/libiio_ubuntu_18_04-ci:latest' + artifactName: 'Linux-Ubuntu-18.04' + build_script: ci-linux.sh + OS_TYPE: default + PACKAGE_TO_INSTALL: '/ci/build/*.deb' ubuntu_20_04_x86_64: image: 'tfcollins/libiio_ubuntu_20_04-ci:latest' artifactName: 'Linux-Ubuntu-20.04' - build_script: ci-debian.sh + build_script: ci-linux.sh + OS_TYPE: default + PACKAGE_TO_INSTALL: '/ci/build/*.deb' ubuntu_22_04_x86_64: image: 'tfcollins/libiio_ubuntu_22_04-ci:latest' artifactName: 'Linux-Ubuntu-22.04' - build_script: ci-debian.sh + build_script: ci-linux.sh + OS_TYPE: default + PACKAGE_TO_INSTALL: '/ci/build/*.deb' debian_bullseye: image: 'tfcollins/libiio_debian_bullseye-ci:latest' artifactName: 'Linux-Debian-11' - build_script: ci-debian.sh - pool: - vmImage: 'ubuntu-latest' + build_script: ci-linux.sh + OS_TYPE: default + PACKAGE_TO_INSTALL: '/ci/build/*.deb' + debian_bookworm: + image: 'tfcollins/libiio_debian_bookworm-ci:latest' + artifactName: 'Linux-Debian-12' + build_script: ci-linux.sh + OS_TYPE: default + PACKAGE_TO_INSTALL: '/ci/build/*.deb' + centos_7: + image: 'tfcollins/libiio_centos_7-ci:latest' + artifactName: 'Linux-CentOS-7' + build_script: ci-linux.sh + OS_TYPE: centos + PACKAGE_TO_INSTALL: '/ci/build/*.rpm' + fedora28: + image: 'tfcollins/libiio_fedora_28-ci:latest' + artifactName: 'Linux-Fedora-28' + build_script: ci-linux.sh + OS_TYPE: centos + PACKAGE_TO_INSTALL: '/ci/build/*.rpm' + fedora34: + image: 'tfcollins/libiio_fedora_34-ci:latest' + artifactName: 'Linux-Fedora-34' + build_script: ci-linux.sh + OS_TYPE: centos + PACKAGE_TO_INSTALL: '/ci/build/*.rpm' + opensuse_15_4: + image: 'tfcollins/libiio_opensuse_15_4-ci:latest' + artifactName: 'Linux-openSUSE-15.4' + build_script: ci-linux.sh + OS_TYPE: opensuse + PACKAGE_TO_INSTALL: '/ci/build/*.rpm' steps: - checkout: self fetchDepth: 1 @@ -64,7 +106,7 @@ jobs: path: '$(Agent.BuildDirectory)/s/build/' - script: | set -e - sudo docker run --rm -t --privileged -e ARTIFACTNAME=$(artifactName) -v "$(Agent.BuildDirectory)/s":"/ci" "$(image)" /bin/bash -c "cd /ci/ && chmod +x ./CI/travis/$(build_script) && ./CI/travis/$(build_script)" + sudo docker run --rm -t --privileged -e ARTIFACTNAME=$(artifactName) -v "$(Agent.BuildDirectory)/s":"/ci" "$(image)" /bin/bash -c "cd /ci/ && chmod +x ./CI/travis/$(build_script) && ./CI/travis/$(build_script) $(OS_TYPE) $(PACKAGE_TO_INSTALL)" displayName: "Build" - task: CopyFiles@2 inputs: @@ -89,7 +131,7 @@ jobs: artifactFeed: libad9361-iio pythonUploadServiceConnection: PyPi - task: TwineAuthenticate@1 - condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) + condition: and(succeeded(), eq(variables.isMain, true), eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) displayName: Twine Authenticate inputs: artifactFeed: test-libad9361-iio @@ -109,12 +151,12 @@ jobs: ls -al cd dist ls -al - condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) + condition: and(succeeded(), eq(variables.isMain, true), eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) displayName: "Update to dev version" - script: | cd /home/vsts/work/1/s/build/bindings/python sudo python -m twine upload --repository-url https://test.pypi.org/legacy/ -u $(USERNAME) -p $(PASSWORD) --skip-existing --config-file $(PYPIRC_PATH) dist/*.whl - condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) + condition: and(succeeded(), eq(variables.isMain, true), eq(variables['artifactName'], 'Linux-Ubuntu-20.04')) displayName: "Deploy python test package" - job: ARMBuilds