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
  • Loading branch information
windytan committed Jun 27, 2024
1 parent 989a33a commit fbdd095
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: build

on:
push:
branches: [ master ]
branches: [ master, dev ]
tags: [ 'v*' ]
pull_request:
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 @@ -39,7 +37,22 @@ jobs:
#- name: Install .deb
# run: 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 +66,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 +97,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 +110,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 +149,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
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 fbdd095

Please sign in to comment.