Skip to content

Adding HydraSDR support #313

Adding HydraSDR support

Adding HydraSDR support #313

Workflow file for this run

name: CI
env:
PYTHONUNBUFFERED: 1
on:
push:
branches: [ master ]
tags: [ "v*" ]
pull_request:
branches: [ master ]
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
architecture: [x64]
include:
- os: windows-latest
python-version: '3.12'
architecture: x86
- os: windows-latest
python-version: '3.12'
architecture: x64
- os: macOS-13
python-version: '3.12'
architecture: x64
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Setup SDR Drivers (Windows)
if: startsWith(matrix.os, 'windows')
run: |
choco install wget --no-progress
wget -nv -O windrivers.zip https://github.com/jopohl/sdrbuild/releases/download/v1.1/win-$ARCH.zip
7z x windrivers.zip -osrc/urh/dev/native/lib/shared
ls src/urh/dev/native/lib/shared
if [[ $ARCH == x64* ]]; then
# install HydraSDR librtlsdr
wget -nv -O hydrasdr-host.zip https://github.com/hydrasdr/rfone_host/releases/download/v1.0.1/hydrasdr-host-tools-Windows-x64-v1.0.1.zip
7z x -y hydrasdr-host.zip -osrc/urh/dev/native/lib/shared
ls src/urh/dev/native/lib/shared
fi
shell: bash
env:
ARCH: ${{ matrix.architecture }}
- name: Setup MSYS2
if: startsWith(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-pkg-config
git
wget
unzip
p7zip
- name: Install Dependencies
run: |
pip install wheel
pip install -r data/requirements.txt
if [[ $OS == ubuntu* ]]
then
sudo apt-get update
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb libxkbcommon-x11-0 x11-utils libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 build-essential cmake git pkg-config
git clone https://github.com/hydrasdr/rfone_host.git
cd rfone_host
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="/usr" ..
make -j$(nproc)
sudo make install
sudo ldconfig
cd ../..
pip install PyVirtualDisplay==0.2.5
elif [[ $OS == windows* ]]
then
pip install pywin32 pyaudio
elif [[ $OS == mac* ]]
then
brew install airspy hackrf librtlsdr libbladerf limesuite portaudio uhd
wget -nv https://github.com/analogdevicesinc/libiio/releases/download/v0.23/macOS-10.15.pkg
sudo installer -pkg macOS-10.15.pkg -target /
sudo cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
sudo install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
file /usr/local/lib/libiio.dylib
otool -L /usr/local/lib/libiio.dylib
sudo cp /Library/Frameworks/iio.framework/Versions/0.23/Headers/iio.h /usr/local/include
wget -nv https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-2.13.2.pkg
sudo installer -pkg SDRplay_RSP_API-MacOSX-2.13.2.pkg -target /
pip install pyaudio
pip install pillow
fi
pip install twine setuptools pytest pytest-xvfb pytest-cov appdirs packaging pyinstaller
python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()"
shell: bash
env:
OS: ${{ matrix.os }}
- name: Build Cython Extensions
run: python src/urh/cythonext/build.py
- name: Create sdist
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.12' }}
run: python setup.py sdist
- run: python setup.py bdist_wheel
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
- name: Build manylinux wheels
if: startsWith(matrix.os, 'ubuntu')
run: |
docker run --rm \
-e PYVER=$(python -c "import sys; print('%s%s' % (sys.version_info.major, sys.version_info.minor))") \
-v `pwd`:/io jopohl/urh_manylinux2_28 /io/data/make_manylinux_wheels.sh
- name: Check wheel
if: startsWith(matrix.os, 'ubuntu')
run: |
pip install dist/*.whl
urh --version
xvfb-run urh autoclose
python data/check_native_backends.py
- name: Build .exe Installer
if: startsWith(matrix.os, 'windows')
run: |
python data/pyinstaller_helper.py
for /f %%i in ('python src/urh/version.py') do set URHVERSION=%%i
iscc /dMyAppVersion=%URHVERSION% /dArch=%PYARCH% data/inno.iss
shell: cmd
env:
PYARCH: ${{ matrix.architecture }}
- name: Check urh_debug.exe
if: startsWith(matrix.os, 'windows')
run: |
cd pyinstaller\urh
urh_debug.exe autoclose
shell: cmd
- name: Build DMG
if: startsWith(matrix.os, 'macos')
run: |
cp data/pyinstaller_macos.spec urh.spec
pyinstaller --clean --distpath ./pyinstaller --workpath ./urh_build urh.spec
mkdir -p dist
cat pyinstaller/main.app/Contents/Info.plist
hdiutil create -volname Universal.Radio.Hacker \
-srcfolder pyinstaller/main.app \
-ov -format UDZO \
dist/Universal.Radio.Hacker-"$(python src/urh/version.py)".dmg
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}
path: dist
- name: Run pytest with coverage
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.12' }}
run: |
touch tests/show_gui
cp tests/.coveragerc .
pytest -s -v --junitxml=junit/test-results.xml --cov=src --cov-config=.coveragerc tests
coverage xml
coverage html
- name: Run pytest without coverage
if: ${{ !startsWith(matrix.os, 'ubuntu') || matrix.python-version != '3.12' }}
run: pytest -s -v --junitxml=junit/test-results.xml tests
- uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: "dist/*.exe,dist/*.dmg"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
generateReleaseNotes: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Upload to PyPi
if: startsWith(github.ref, 'refs/tags/')
run: |
if [[ $OS == ubuntu* ]]
then
twine upload --skip-existing dist/*
else
twine upload --skip-existing dist/*.whl
fi
shell: bash
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
OS: ${{ matrix.os }}