From d4efc94c3c4074f5e7d84330d462346a35894d66 Mon Sep 17 00:00:00 2001 From: schneider Date: Mon, 9 Sep 2024 22:13:48 +0200 Subject: [PATCH] ci: use a matrix for modern ubuntu versions --- .github/workflows/ci.yml | 88 +++++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55663a0..2f099c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,16 +24,37 @@ jobs: - uses: quentinguidee/pep8-action@v1 with: arguments: '--max-line-length=120 --ignore E265,E266,E402,E501,E704,E712,E713,E714,E711,E722,E741,W504,W605 --exclude *.yml.py,docs/*,python/bindings/* --filename=*.py,iridium-extractor' - ubuntu-24-04: - name: Ubuntu 24.04 - runs-on: ubuntu-24.04 + ubuntu: + name: Ubuntu + strategy: + matrix: + os: + - version: ubuntu-20.04 + ppa: gnuradio/gnuradio-releases + packages: libsndfile-dev libspdlog-dev pybind11-dev + osmosdr-from-source: True + - version: ubuntu-20.04 + ppa: gnuradio/gnuradio-releases-3.9 + packages: libsndfile-dev libspdlog-dev pybind11-dev gr-osmosdr + - version: ubuntu-22.04 + packages: libsndfile1-dev gr-osmosdr + - version: ubuntu-24.04 + packages: gr-osmosdr + runs-on: ${{matrix.os.version}} steps: - uses: actions/checkout@v4 - + - name: Add PPA + if: ${{matrix.os.ppa}} + run: | + sudo add-apt-repository ppa:${{matrix.os.ppa}} - name: Install GNU Radio run: | sudo apt update sudo apt install gnuradio-dev cmake + - name: Install extra packages + if: ${{matrix.os.packages}} + run: | + sudo apt install ${{matrix.os.packages}} - name: Build run: | cmake -B build @@ -47,48 +68,49 @@ jobs: run: | cd build make test - - name: Open SDR with gr-soapy + - name: Demod PRBS15 SigMF run: | - iridium-extractor examples/hackrf-soapy.conf 2>&1 | tee stderr-out - cat stderr-out | grep "RuntimeError: no hackrf device matches" - - name: Open SDR with gr-osmosdr + iridium-extractor test-data/prbs15-2M-20dB.sigmf-meta |grep ^RAW > prbs15-2M-20dB.bits + grep "RAW: prbs15-2M-20dB 0000599.9996 1622000000 N:32.12-80.05 I:00000000000 100% 0.13551 179 0011000000110000111100111000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000" prbs15-2M-20dB.bits + - name: Demod with decimation 4 run: | - sudo apt install gr-osmosdr - iridium-extractor examples/hackrf-10msps.conf 2>&1 | tee stderr-out - cat stderr-out | grep "RuntimeError: Failed to use '0' as HackRF device index: not enough devices" - - ubuntu-22-04: - name: Ubuntu 22.04 - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 + iridium-extractor -D 4 test-data/prbs15-2M-20dB.sigmf-meta |grep ^RAW > prbs15-2M-20dB-D4.bits + grep "RAW: prbs15-2M-20dB 0000599.9996 1622000000 N:32.12-80.05 I:00000000000 100% 0.13577 179 0011000000110000111100111000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000" prbs15-2M-20dB-D4.bits + - name: Demod with decimation 8 + run: | + iridium-extractor -D 8 test-data/prbs15-2M-20dB.sigmf-meta |grep ^RAW > prbs15-2M-20dB-D8.bits + grep "RAW: prbs15-2M-20dB 0000599.9996 1622000000 N:32.12-80.05 I:00000000000 100% 0.13643 179 0011000000110000111100111000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000" prbs15-2M-20dB-D8.bits + - name: Test raw samples + run: | + ln -s prbs15-2M-20dB.sigmf-data test-data/prbs15-2M-20dB.fc32 + iridium-extractor --offline -c 1622000000 -r 2000000 -f float test-data/prbs15-2M-20dB.fc32 |grep ^RAW > prbs15-2M-20dB.bits.raw + cmp prbs15-2M-20dB.bits prbs15-2M-20dB.bits.raw + - name: Test SigMF Archive support + run: | + tar cf test-data/prbs15-2M-20dB.sigmf test-data/prbs15-2M-20dB.sigmf-* + iridium-extractor test-data/prbs15-2M-20dB.sigmf |grep ^RAW > prbs15-2M-20dB.bits.archive + cmp prbs15-2M-20dB.bits prbs15-2M-20dB.bits.archive - - name: Install GNU Radio + - name: Open SDR with gr-soapy run: | - sudo apt update - sudo apt install gnuradio-dev cmake libsndfile1-dev - - name: Build + iridium-extractor examples/hackrf-soapy.conf 2>&1 | tee stderr-out + cat stderr-out | grep "RuntimeError: no hackrf device matches" + - name: Install gr-osmosdr from source + if: ${{matrix.os.osmosdr-from-source}} run: | + git clone https://github.com/osmocom/gr-osmosdr + cd gr-osmosdr cmake -B build cmake --build build - - name: Install - run: | cd build sudo make install sudo ldconfig - - name: Unit Tests - run: | - cd build - make test - - name: Open SDR with gr-soapy - run: | - iridium-extractor examples/hackrf-soapy.conf 2>&1 | tee stderr-out - cat stderr-out | grep "RuntimeError: no hackrf device matches" + - name: Open SDR with gr-osmosdr run: | - sudo apt install gr-osmosdr iridium-extractor examples/hackrf-10msps.conf 2>&1 | tee stderr-out - cat stderr-out | grep "RuntimeError: Failed to use '0' as HackRF device index: not enough devices" + cat stderr-out | grep "RuntimeError: Failed to use '0' as HackRF device index: not enough devices\|No supported devices found" + gr-ppa: name: Ubuntu 20.04 + GNURadio PPA runs-on: ubuntu-20.04