Skip to content

Commit

Permalink
Add debian:buster workflow to CI
Browse files Browse the repository at this point in the history
* Build the project on debian buster (oldoldstable)
* Avoid directly adding Channels to a vector to silence the ABI warning
* Don't try to run tests on platforms where we don't install catch2
* Add install: true to meson.build to make the .deb package installable
  • Loading branch information
windytan committed Jun 27, 2024
1 parent 989a33a commit 0e19fb3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 34 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [ master ]

jobs:
ubuntu-build:
build-ubuntu:
runs-on: ubuntu-latest

steps:
Expand All @@ -21,10 +21,8 @@ jobs:
run: meson setup -Dwerror=true build
- name: compile
run: cd build && meson compile
- name: test
run: cd build && meson test

build-deb:
build-ubuntu-deb-package:
runs-on: ubuntu-latest

steps:
Expand All @@ -35,11 +33,25 @@ jobs:
run: sudo mk-build-deps --install --tool 'apt-get --yes'
- name: Build .deb
run: debuild -us -uc
# TODO: need a way to find the binary
#- name: Install .deb
# run: dpkg -i ../redsea_*.deb
- name: Install .deb
run: sudo dpkg -i ../redsea_*.deb

macos-build:
build-debian-oldoldstable:
runs-on: ubuntu-latest
container: debian:buster

steps:
- uses: actions/checkout@v4
- name: Install dependencies (apt-get)
run: apt-get update && apt-get -y install python3-pip ninja-build build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev
- name: Install meson (pip3)
run: pip3 install --user meson
- name: meson setup
run: export PATH=$PATH:$HOME/.local/bin && meson setup -Dwerror=true build
- name: compile
run: export PATH=$PATH:$HOME/.local/bin && cd build && meson compile

build-test-macos:
runs-on: macos-latest

steps:
Expand All @@ -53,7 +65,7 @@ jobs:
- name: test
run: cd build && meson test

windows-msys2-mingw-build:
build-windows-msys2-mingw:
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -84,9 +96,6 @@ jobs:
shell: msys2 {0}
run: |
meson setup -Dwerror=true build && cd build && meson compile
- name: test
shell: msys2 {0}
run: cd build && meson test
- name: Package into distrib
shell: msys2 {0}
run: >-
Expand All @@ -100,7 +109,7 @@ jobs:
awk '{$1=$1};1' |
xargs -I{} cp {} distrib/
windows-cygwin-build:
build-windows-cygwin:
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -139,6 +148,3 @@ jobs:
- name: Build redsea
shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}'
run: meson setup -Dwerror=true build && cd build && meson compile
- name: test
shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}'
run: cd build && meson test
26 changes: 15 additions & 11 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,29 @@
* New features:
* Add support for Enhanced RadioText (eRT)
* Add support for Long PS in Group 15A (#104)
* Add runtime option to disable error correction with --no-fec
* Maintainability:
* Migrate build system from autotools to meson (#90)
* Switch from packaged-in JsonCPP to nlohmann-json (#109)
* Add GitHub Workflows CI builds for macOS and Windows via MSYS2/MinGW + Cygwin
* Add basic Catch2 unit tests (#84)
* Add .clang-format (not automated)
* Remove unmaintained build options for non-liquid, non-TMC builds
* Fix compiler warnings, issues identified via static analysis, and other code cleanup
* Add runtime option `--no-fec` for disabling error correction
* UX changes:
* Breaking: Print a warning to stderr if the raw MPX input sample rate is
not specified
not specified (breaks the previous silent assumption of 171 kHz)
* Improve error reporting in general
* Add `--output hex` (same as `--output-hex`) to mirror `--input hex`
* Fixes:
* Fix detection of invalid date/time (timestamps >2000 years ago)
* Noise resistance improvements:
* Noise resistance improvements (#106):
* Require three (instead of two) repeats of a new PI before accepting it
* Require three (instead of two) synchronization pulses before locking
* Maintainability:
* Migrate build system from autotools to meson (#90)
* Switch from patched, packaged-in JsonCPP to external nlohmann-json (#109)
* Breaking: The order of some JSON elements has changed (insertion order
instead of alphabetical)
* Add automated CI builds for macOS, Windows (MSYS2/MinGW + Cygwin), Ubuntu-latest,
Debian Buster
* Add Debian packaging (#101)
* Add basic Catch2 unit tests (#84)
* Add .clang-format (not automated)
* Remove unmaintained build options for non-liquid, non-TMC builds
* Fix compiler warnings, issues identified via static analysis, and other code cleanup

## 0.21 (2024-01-26)

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ On Ubuntu:

$ sudo apt install git build-essential meson libsndfile1-dev libliquid-dev

Or on older Debians:

$ sudo apt-get install python3-pip ninja-build build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev
$ pip3 install --user meson

Or on macOS using Homebrew:

$ brew install meson libsndfile liquid-dsp nlohmann-json
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ sources_no_main = [
'src/util.cc'
]

executable('redsea', [sources_no_main, 'src/redsea.cc'], dependencies: [iconv, json, liquid, sndfile])
executable('redsea', [sources_no_main, 'src/redsea.cc'], dependencies: [iconv, json, liquid, sndfile],
install: true)


##################
Expand Down
12 changes: 6 additions & 6 deletions src/redsea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,26 @@ int processMPXInput(Options options) {

auto& output_stream = options.feed_thru ? std::cerr : std::cout;

std::vector<Channel> channels;
std::vector<std::unique_ptr<Channel>> channels;
std::vector<std::unique_ptr<Subcarrier>> subcarriers;
for (uint32_t i = 0; i < options.num_channels; i++) {
channels.emplace_back(options, i, output_stream);
channels.emplace_back(std::make_unique<Channel>(options, i, output_stream));
subcarriers.push_back(std::make_unique<Subcarrier>(options));
}

while (!mpx.eof()) {
mpx.fillBuffer();
for (uint32_t i = 0; i < options.num_channels; i++) {
channels[i].processBits(subcarriers[i]->processChunk(mpx.readChunk(i)));
if (channels[i].getSecondsSinceCarrierLost() > 10.f &&
channels[i]->processBits(subcarriers[i]->processChunk(mpx.readChunk(i)));
if (channels[i]->getSecondsSinceCarrierLost() > 10.f &&
subcarriers[i]->getSecondsSinceLastReset() > 5.f) {
subcarriers[i]->reset();
channels[i].resetPI();
channels[i]->resetPI();
}
}
}

for (uint32_t i = 0; i < options.num_channels; i++) channels[i].flush();
for (uint32_t i = 0; i < options.num_channels; i++) channels[i]->flush();

return EXIT_SUCCESS;
}
Expand Down

0 comments on commit 0e19fb3

Please sign in to comment.