Skip to content

Commit

Permalink
CI:update azure builds
Browse files Browse the repository at this point in the history
Signed-off-by: Raluca Groza <[email protected]>
  • Loading branch information
ccraluca authored and AAndrisa committed Apr 16, 2024
1 parent 9922112 commit 9aeaef6
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 14 deletions.
41 changes: 41 additions & 0 deletions CI/travis/ci-linux.sh
Original file line number Diff line number Diff line change
@@ -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
89 changes: 75 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
${{ elseif eq(variables['Build.Reason'], 'PullRequest') }}:
downloadBranch: $[ format('refs/heads/{0}',replace(variables['System.PullRequest.TargetBranch'], 'libad9361-iio-v0', 'libiio-v0')) ]
${{ else }}:
downloadBranch: 'refs/heads/main'
downloadBranch: 'refs/heads/libiio-v0'

trigger:
branches:
Expand All @@ -35,22 +35,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
Expand All @@ -66,7 +108,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:
Expand All @@ -91,7 +133,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
Expand All @@ -111,12 +153,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
Expand Down Expand Up @@ -160,7 +202,7 @@ jobs:
runBranch: $(downloadBranch)
path: '$(Agent.BuildDirectory)/s/build/'
- script: |
set -e
set -e
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
sudo apt-get install -y g++-arm-linux-gnueabihf
Expand All @@ -185,16 +227,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:
Expand Down

0 comments on commit 9aeaef6

Please sign in to comment.