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 <raluca.groza@analog.com>
  • Loading branch information
ccraluca committed Jul 12, 2023
1 parent 05fbfed commit f7c81f9
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 16 deletions.
93 changes: 93 additions & 0 deletions CI/travis/ci-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash

set -x
uname -a

install_sphinx() {
python --version

sudo python3 -m pip install sphinx
sudo python3 -m pip install sphinx-rtd-theme furo
}

handle_centos() {
# FIXME: see about adding `libserialport-dev` from EPEL ; maybe libusb-1.0.0-devel...
yum -y groupinstall 'Development Tools'

if is_centos_at_least_ver "8" ; then
# 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 python3
install_sphinx
else
yum -y install python3
install_sphinx
fi

# CMake has a bug when installed from repos. Must grab from kitware
yum -y install wget
wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz
tar -zxvf cmake-3.15.2.tar.gz
cd cmake-3.15.2
./bootstrap
make
make install
cd ..

# Need libzstd from EPEL
yum -y install epel-release
yum -y install libzstd

yum -y install libxml2-devel libusb1-devel doxygen libaio-devel \
avahi-devel bzip2 gzip rpm rpm-build

yum localinstall -y $PACKAGE_TO_INSTALL

python3 -m pip install pylibiio --no-binary :all:

# Build project
mkdir -p build
cd build
sudo cmake -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON ..
sudo make && make package && make test
sudo make install
ldconfig
cd ..
cd bindings/python
sudo pip3 install -r requirements_dev.txt
export LD_LIBRARY_PATH=/usr/local/lib/
sudo python3 -m pytest -vs --skip-scan
}

handle_default() {
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake doxygen graphviz \
libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev \
libxml2-dev rpm tar bzip2 gzip flex bison libserialport-dev \
python3 python3-pip python3-setuptools

sudo dpkg -i $PACKAGE_TO_INSTALL

sudo python3 -m pip install pylibiio --no-binary :all:
install_sphinx

# Build project
mkdir -p build
cd build
sudo cmake -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON ..
sudo make && make package && make test
sudo make install
ldconfig
cd ..
cd bindings/python
sudo pip3 install -r requirements_dev.txt
sudo python3 -m pytest -vs --skip-scan
}

handle_ubuntu() {
handle_default
}

handle_debian() {
handle_default
}
90 changes: 74 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,52 @@ 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
BUILD_TYPE: ubuntu
PACKAGE_TO_INSTALL: '/ci/build/*.deb'
ubuntu_20_04_x86_64:
imageName: 'ubuntu-20.04'
OS_TYPE: 'ubuntu_docker'
OS_VERSION: focal
image: 'tfcollins/libiio_ubuntu_20_04-ci:latest'
artifactName: 'Linux-Ubuntu-20.04'
PACKAGE_TO_INSTALL: 'build/*.deb'
build_script: ci-linux.sh
BUILD_TYPE: ubuntu
PACKAGE_TO_INSTALL: '/ci/build/*.deb'
ubuntu_22_04_x86_64:
imageName: 'ubuntu-22.04'
OS_TYPE: 'ubuntu_docker'
OS_VERSION: jammy
image: 'tfcollins/libiio_ubuntu_22_04-ci:latest'
artifactName: 'Linux-Ubuntu-22.04'
PACKAGE_TO_INSTALL: 'build/*.deb'
pool:
vmImage: $(imageName)
build_script: ci-linux.sh
BUILD_TYPE: ubuntu
PACKAGE_TO_INSTALL: '/ci/build/*.deb'
debian_bullseye:
image: 'tfcollins/libiio_debian_bullseye-ci:latest'
artifactName: 'Linux-Debian-11'
build_script: ci-linux.sh
BUILD_TYPE: debian
PACKAGE_TO_INSTALL: '/ci/build/*.deb'
centos_7:
image: 'tfcollins/libiio_centos_7-ci:latest'
artifactName: 'Linux-CentOS-7'
build_script: ci-linux.sh
BUILD_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
BUILD_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
BUILD_TYPE: centos
PACKAGE_TO_INSTALL: '/ci/build/*.rpm'
steps:
- checkout: self
fetchDepth: 1
Expand All @@ -50,9 +80,18 @@ jobs:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Agent.BuildDirectory)/s/build/'
- script: ./CI/travis/before_install_linux
displayName: "Install Dependencies"
- script: ./CI/travis/make_linux
- script: |
apt-get install -y yum
yum localinstall -y $PACKAGE_TO_INSTALL
condition: eq(variables['artifactName'], 'Linux-CentOS-7')
displayName: "Install libiio"
- script: |
dpkg -i $PACKAGE_TO_INSTALL
condition: ne(variables['artifactName'], 'Linux-CentOS-7')
displayName: "Install libiio"
- script: |
set -e
sudo docker run --rm -t --privileged -e ARTIFACTNAME=$(artifactName) -v "$(Agent.BuildDirectory)/s":"/ci" "$(image)" /bin/bash -c "sudo dpkg -i $PACKAGE_TO_INSTALL"
displayName: "Build"
- task: CopyFiles@2
inputs:
Expand Down Expand Up @@ -171,16 +210,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: 'macOS_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 f7c81f9

Please sign in to comment.