Merge pull request #876 from anarkiwi/pre2 #2016
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
name: CI Test | |
on: [push, pull_request] | |
jobs: | |
ci-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: false | |
virtualenvs-in-project: false | |
version: 1.4.2 | |
- name: Get dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
g++ \ | |
gcc \ | |
git \ | |
gnuradio-dev \ | |
libboost-all-dev \ | |
libev-dev \ | |
libopencv-dev \ | |
libuhd-dev \ | |
libunwind-dev \ | |
make \ | |
pkg-config \ | |
software-properties-common \ | |
sox \ | |
uhd-host \ | |
wget \ | |
&& grep -h 'git clone' docker/*|sed -E 's/RUN\s+git clone\s+//g'|sort|uniq|xargs -L1 git clone | |
- name: Install dependencies | |
run: | | |
for repodir in flatbuffers json libsigmf gr-iqtlabs ; do \ | |
mkdir -p ${repodir}/build && cd ${repodir}/build && \ | |
cmake -DUSE_SYSTEM_JSON=ON -DUSE_SYSTEM_FLATBUFFERS=ON .. && make -j "$(nproc)" && sudo make install && cd ../.. ; \ | |
done && \ | |
sudo ldconfig -v && \ | |
poetry config virtualenvs.create false && \ | |
poetry install --no-interaction && \ | |
sudo dpkg -r --force-depends python3-numpy | |
- name: test gamutrf-samples2raw | |
env: | |
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages | |
run: | | |
gamutrf-samples2raw --help && \ | |
dd if=/dev/zero of=/tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.s16 bs=4 count=1000000 && \ | |
gamutrf-samples2raw /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.s16 --outfmt=float && \ | |
dd if=/dev/zero of=/tmp/floats bs=8 count=1000000 && \ | |
diff /tmp/gamutrf_recording_ettus__gain40_1_1Hz_1000000sps.raw /tmp/floats | |
- name: Code Quality - Black | |
run: | | |
poetry run black gamutrf --check | |
- name: Code Quality - Pylint | |
run: | | |
poetry run pylint --fail-under=6 gamutrf/ | |
- name: Code Quality - Pytype | |
env: | |
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages | |
run: | | |
sudo pip3 install pytype=="$(grep -E "pytype = " pyproject.toml | grep -Eo "[0-9\.]+")" && \ | |
pytype -k gamutrf/ | |
- name: Test with pytest | |
env: | |
PYTHONPATH: /usr/local/lib/python3.10/dist-packages:/usr/lib/python3/dist-packages | |
run: | | |
poetry run pytest --cov-report term-missing --cov=. --cov-report=xml tests/ | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
verbose: false # optional (default = false) | |
fail_ci_if_error: false | |
if: github.repository == 'iqtlabs/gamutrf' |