-
Notifications
You must be signed in to change notification settings - Fork 14
92 lines (89 loc) · 3.4 KB
/
ci-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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@v5
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 \
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/*|grep -v pytorch|sed -E 's/RUN\s+git clone\s+//g'|sort|uniq|xargs -L1 git clone
- name: install gnuradio
run: |
sudo add-apt-repository ppa:gnuradio/gnuradio-releases && sudo apt-get update && \
sudo apt-get install -y --no-install-recommends gnuradio-dev python3-packaging
- 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 -C gamutrflib && \
poetry install --no-interaction -C gamutrfwaterfall && \
poetry install --no-interaction -C utils/mavlink-api && \
poetry install --no-interaction && \
sudo dpkg -r --force-depends python3-numpy
- name: Code Quality - Black
run: |
poetry run black augment --check
poetry run black gamutrf --check
poetry run black gamutrflib --check
poetry run black gamutrfwaterfall --check
poetry run black torchserve --check
poetry run black utils --check
- name: Code Quality - Pylint
run: |
poetry run pylint --fail-under=6 gamutrf/ gamutrflib/ gamutrfwaterfall/
- 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\.]+")" && \
sudo pip3 install -U pyserial && \
pytype -k gamutrf/ && \
pytype -k gamutrflib/ && \
pytype -k utils/mavlink-api
- 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/ gamutrfwaterfall/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'