Add urh
This commit is contained in:
195
Software/Universal Radio Hacker/.github/workflows/ci.yml
vendored
Normal file
195
Software/Universal Radio Hacker/.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,195 @@
|
||||
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, windows-2019, macos-10.15]
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
architecture: [x64]
|
||||
include:
|
||||
- os: windows-2019
|
||||
python-version: '3.7'
|
||||
architecture: x86
|
||||
exclude:
|
||||
- os: windows-2019
|
||||
python-version: '3.8'
|
||||
- os: windows-2019
|
||||
python-version: '3.9'
|
||||
- os: windows-2019
|
||||
python-version: '3.10'
|
||||
- os: macOS-10.15
|
||||
python-version: '3.7'
|
||||
- os: macOS-10.15
|
||||
python-version: '3.8'
|
||||
- os: macOS-10.15
|
||||
python-version: '3.10'
|
||||
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
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
|
||||
shell: bash
|
||||
env:
|
||||
ARCH: ${{ matrix.architecture }}
|
||||
|
||||
- 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
|
||||
pip install PyVirtualDisplay==0.2.5
|
||||
elif [[ $OS == windows* ]]
|
||||
then
|
||||
pip install pywin32 pipwin
|
||||
pipwin install pyaudio
|
||||
elif [[ $OS == mac* ]]
|
||||
then
|
||||
brew tap pothosware/homebrew-pothos
|
||||
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 pytest-faulthandler six 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: ${{ matrix.python-version == '3.9' && startsWith(matrix.os, 'ubuntu') }}
|
||||
run: python setup.py sdist
|
||||
|
||||
- run: python setup.py bdist_wheel
|
||||
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
|
||||
|
||||
- name: Build manylinux2014
|
||||
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_manylinux2014 /io/data/make_manylinux2014_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@v2
|
||||
with:
|
||||
name: dist-${{ matrix.os }}
|
||||
path: dist
|
||||
|
||||
- name: Run pytest with coverage
|
||||
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.9' }}
|
||||
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.9' }}
|
||||
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/"
|
Reference in New Issue
Block a user