-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 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 | ||
- 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 | ||
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 |