init #85
Workflow file for this run
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: sdrterm | |
on: [push] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
WD=$(pwd); | |
echo $WD; | |
sudo apt-get update; | |
sudo apt-get install wget sox socat unzip git make cmake libitpp-dev libsndfile1-dev portaudio19-dev coreutils sed -y; | |
cd /tmp; | |
git clone https://github.com/szechyjs/mbelib.git | |
cd mbelib && mkdir build && cd build && cmake .. && make -j$(nproc) && sudo make install && sudo ldconfig; | |
cd /tmp; | |
git clone https://github.com/szechyjs/dsd.git; | |
cd dsd && mkdir build && cd build && cmake .. && make -j$(nproc) && sudo make install && sudo ldconfig; | |
cd $WD; | |
python -m pip install --upgrade pip | |
PIP_NO_BINARY="" pip install . --upgrade | |
pip install flake8 pytest pytest-cov --upgrade | |
chmod +x example.sh; | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 src/ --count --exit-zero --max-line-length=127 --statistics --ignore E741,F811 | |
- name: Test with pytest | |
run: | | |
cd src/ | |
python -m pytest ../test | |
cd .. | |
- name: Run functionality tests | |
run: | | |
export OUT_PATH=.; | |
export DSD_CMD="dsd -q -i - -o /dev/null -n"; | |
export SDRTERM_EXEC="python -m sdrterm"; | |
declare -A sums; | |
sums["${OUT_PATH}/outB.wav"]="b8058749ff0e25eab70f92dda86c2507"; | |
sums["${OUT_PATH}/outd.wav"]="d51e36787d2cf8a10be87a1e123bb976"; | |
sums["${OUT_PATH}/outf.wav"]="07e31be2ff4f16b91adcf540a570c03e"; | |
sums["${OUT_PATH}/outh.wav"]="576409e4a3cd5e76950aa0134389d75a"; | |
sums["${OUT_PATH}/outi.wav"]="07e31be2ff4f16b91adcf540a570c03e"; | |
sums["${OUT_PATH}/outd-B.wav"]="d51e36787d2cf8a10be87a1e123bb976"; | |
sums["${OUT_PATH}/outf-B.wav"]="07e31be2ff4f16b91adcf540a570c03e"; | |
sums["${OUT_PATH}/outh-B.wav"]="576409e4a3cd5e76950aa0134389d75a"; | |
sums["${OUT_PATH}/outi-B.wav"]="07e31be2ff4f16b91adcf540a570c03e"; | |
sums["${OUT_PATH}/outi16.wav"]="9f21f81dd274b3695adbb0418f787b48"; | |
sums["${OUT_PATH}/outi16X.wav"]="9f21f81dd274b3695adbb0418f787b48"; | |
sums["${OUT_PATH}/outu8.wav"]="18f1c6cbe373121a3f4c1bfe9f282467"; | |
wget https://www.sigidwiki.com/images/f/f5/DMR.zip && unzip DMR.zip && rm DMR.zip; | |
./example.sh SDRSharp_20160101_231914Z_12kHz_IQ.wav; | |
cnt=0; | |
total=${#sums[@]}; | |
declare -A z="( `sed -E "s/^((\d|\w)+)\s*((\d|\w|\/|\-|\.)+)$/[\3]=\1/g" <<< $(md5sum ${OUT_PATH}/*.wav)` )"; | |
for i in "${!sums[@]}"; do | |
if [[ "${sums["$i"]}" == "${z["$i"]}" ]]; then | |
echo "checksum matched: ${i}" | |
cnt=$(( cnt + 1 )); | |
else | |
printf "\033[31mFAILED: ${i}\n\tEXPECTED: ${sums["$i"]}\n\tRECEIVED: ${z["$i"]}\n\033[31m" 1>&2; | |
fi | |
done | |
(( cnt == total )) |