Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci builds v0 #124

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
85 changes: 73 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -183,16 +225,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
Loading