Skip to content

Commit

Permalink
azure-pipelines.yml: add new builds for Linux system
Browse files Browse the repository at this point in the history
Signed-off-by: Andreea Andrisan <[email protected]>
  • Loading branch information
AAndrisa committed Apr 16, 2024
1 parent 9f2c2c3 commit ec7e3c8
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 9 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
60 changes: 51 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ec7e3c8

Please sign in to comment.