Skip to content

Commit

Permalink
Add CI for python bindings
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Oct 1, 2024
1 parent cdf315e commit 23c6bc6
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/python_bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Build, test, and deploy Python bindings
name: Python bindings

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
container: tfcollins/libiio_ubuntu_22_04-ci:latest

steps:
- uses: actions/checkout@v2

# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-virtualenv python3-venv
- name: Install C library
run: |
mkdir build && cd build
cmake ..
make -j
sudo make install
sudo ldconfig
cd ..
- name: Build and test Python bindings
run: |
python3 -m venv venv
source venv/bin/activate
pip3 install build
cd bindings/python
python3 -m build
pip install dist/*.whl
cd ../..
shell: bash

- name: Test Python bindings
run: |
source venv/bin/activate
python3 -c "import iio"
shell: bash

- name: Archive Python bindings
uses: actions/upload-artifact@v4
with:
name: python-wheel
path: bindings/python/dist/*.whl

0 comments on commit 23c6bc6

Please sign in to comment.