diff --git a/.github/workflows/pyhubblenetwork.yml b/.github/workflows/pyhubblenetwork.yml new file mode 100644 index 0000000..50418da --- /dev/null +++ b/.github/workflows/pyhubblenetwork.yml @@ -0,0 +1,40 @@ +name: PyHubbleNetwork CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout sdr-docker + uses: actions/checkout@v6 + + - name: Set up Python 3.12 + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Build local image + run: mkdir -p decoder-src && docker build -t sdr-docker:pr-test . + + - name: Checkout pyhubblenetwork + uses: actions/checkout@v6 + with: + repository: HubbleNetwork/pyhubblenetwork + path: pyhubblenetwork + + - name: Install pyhubblenetwork + run: | + cd pyhubblenetwork + python -m pip install --upgrade pip + pip install -e ".[dev]" + + - name: Run sat integration tests + env: + SDR_DOCKER_IMAGE: sdr-docker:pr-test + run: pytest pyhubblenetwork/tests/test_sat_integration.py -v --tb=short diff --git a/Dockerfile b/Dockerfile index 4a268bb..1c6f17c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,15 +67,23 @@ COPY run_stream.py /app/ COPY src/ /app/src/ COPY entrypoint.sh /app/ +# Optionally install hubble-satnet-decoder from a local source tree. +# In CI, set USE_LOCAL_DECODER=1 and copy the source into decoder-src/ +# before building. Normal builds leave decoder-src/ empty and install from PyPI. +ARG USE_LOCAL_DECODER=0 +COPY decoder-src/ /tmp/decoder-src/ + # Install the python package # GNU Radio from the Ubuntu PPA is compiled against NumPy 1.x; # pip must not upgrade numpy beyond 1.x or gnuradio will fail to import. # --ignore-installed is needed because some system distutils packages # (blinker, etc.) can't be pip-uninstalled cleanly. RUN python3 -m pip install --upgrade pip setuptools wheel -RUN python3 -m pip install --ignore-installed \ - "hubble-satnet-decoder>=1.1.1" \ - "numpy>=1.26,<2" +RUN if [ "$USE_LOCAL_DECODER" = "1" ]; then \ + python3 -m pip install --ignore-installed /tmp/decoder-src "numpy>=1.26,<2"; \ + else \ + python3 -m pip install --ignore-installed "hubble-satnet-decoder>=1.1.1" "numpy>=1.26,<2"; \ + fi RUN python3 -m pip install --ignore-installed -e . "numpy>=1.26,<2" # Start the live spectrogram + decoder web server