Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: use gnuradio4 docker container #178

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 22 additions & 44 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,45 @@ on:
permissions:
contents: read
pages: write
packages: read
id-token: write

jobs:
build:
name: "${{ matrix.configurations.name }} | ${{ matrix.cmake-build-type }}"
environment: configure coverage
runs-on: ${{ matrix.configurations.os }}
runs-on: ubuntu-latest
container: "ghcr.io/fair-acc/gr4-build-container:latest"
strategy:
fail-fast: false
matrix:
configurations:
- name: Ubuntu gcc 13
os: ubuntu-22.04
compiler: gcc13
# - name: Ubuntu Latest clang
# os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-2004
# compiler: clang
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
- name: Ubuntu gcc 14
compiler: gcc-14
cmake-build-type: [ Release, Debug ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-depth: 0

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-fetchContent-cache
with:
path: ${{runner.workspace}}/build/_deps
key: ${{ runner.os }}-${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}

- name: Install emscripten
shell: bash
run: |
cd
git clone --depth=1 https://github.com/emscripten-core/emsdk.git
cd emsdk
# Download and install emscripten.
./emsdk install 3.1.51 # (2023-12-14)
# Make "active" for the current user. (writes .emscripten file)
./emsdk activate 3.1.51
- name: Install gcovr
shell: bash
if: matrix.cmake-build-type == 'Debug'
run: |
python3 -m pip install gcovr --user --no-warn-script-location
gcovr --version
- name: Install gcc-13
run: |
sudo apt-get install -y gcc-13 g++-13 # gcovr # packaged gcovr is too old for gcc13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 110 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13
key: ${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}

- name: Install openGL
run: |
sudo apt update
sudo apt install -y libx11-dev libgl1-mesa-dev libsdl2-dev
# Temporary dependencies for gr-digitizers (should become runtime dependency)
- name: "Install timing system dependencies: etherbone"
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install build-essential autoconf automake libtool
git clone --branch v2.1.3 --depth=1 https://ohwr.org/project/etherbone-core.git
cd etherbone-core/api
touch ChangeLog # add an empty changelog file which is required by autotools
Expand All @@ -101,29 +75,33 @@ jobs:
wget -O - https://labs.picotech.com/Release.gpg.key|sudo apt-key add -
sudo add-apt-repository 'deb https://labs.picotech.com/rc/picoscope7/debian/ picoscope main'
sudo apt update
sudo apt install -y udev libusb-1.0-0-dev libps3000a libps4000a libps5000a libps6000 libps6000a || true # ignore udev errors in post install because of udev in container
sudo apt install -y udev libusb-1.0-0-dev libps3000a libps4000a libps5000a libps6000 libps6000a libx11-dev libgl1-mesa-dev libsdl2-dev || true # ignore udev errors in post install because of udev in container
- name: Configure CMake
shell: bash
env:
CC: gcc-14
CXX: g++-14
run: |
export SYSTEM_NODE=`which node` # use system node instead of old version distributed with emsdk for threading support
source ~/emsdk/emsdk_env.sh
$EMSDK_HOME/emsdk activate $EMSDK_VERSION
source $EMSDK_HOME/emsdk_env.sh
cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DEMCMAKE_COMMAND=`which emcmake`
- name: Build
shell: bash
run: |
source ~/emsdk/emsdk_env.sh
$EMSDK_HOME/emsdk activate $EMSDK_VERSION
source $EMSDK_HOME/emsdk_env.sh
cmake --build ../build
- name: execute tests
if: matrix.configurations.compiler != 'gcc13' || matrix.cmake-build-type != 'Debug'
if: matrix.configurations.compiler != 'gcc-14' || matrix.cmake-build-type != 'Debug'
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest --output-on-failure

- name: execute tests with coverage
if: matrix.configurations.compiler == 'gcc13' && matrix.cmake-build-type == 'Debug'
if: matrix.configurations.compiler == 'gcc-14' && matrix.cmake-build-type == 'Debug'
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --target opendigitizer_coverage
Expand All @@ -144,7 +122,7 @@ jobs:
name: Deploy to GitHub Pages
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
environment: github-pages
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: build
steps:
- name: "Setup Pages"
Expand Down
12 changes: 6 additions & 6 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
include(FetchContent)

FetchContent_Declare(
opencmw-cpp
GIT_REPOSITORY https://github.com/fair-acc/opencmw-cpp.git
GIT_TAG c7236c423f4f1f4de8a762c1e946f6ad76cd0a8d # main as of 2024-03-13
graph-prototype
GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git
GIT_TAG 5e15e8478d267a5e74fdd3b310a7483a690fe1b4 # main as of 2024-04-25
)

FetchContent_Declare(
graph-prototype
GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git
GIT_TAG 3cb5c2aff7046bc3760ccd8f8b701cbde361ecfd # main as of 2024-04-05
opencmw-cpp
GIT_REPOSITORY https://github.com/fair-acc/opencmw-cpp.git
GIT_TAG 0fb3758c3ffe7707aa5e0bd2ad25f9e8fb19f79d# main as of 2024-04-26
)

FetchContent_Declare(
Expand Down
1 change: 1 addition & 0 deletions src/service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if(OPENDIGITIZER_ENABLE_TESTING)
-U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=0) # fortify_source is not possible without optimization
target_link_libraries(project_options INTERFACE --coverage)
set(GCOVR_ADDITIONAL_ARGS --print-summary --gcov-ignore-errors=all --verbose)
append_coverage_compiler_flags()
setup_target_for_coverage_gcovr_xml(
NAME
Expand Down
2 changes: 1 addition & 1 deletion src/service/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FetchContent)
FetchContent_Declare(
gr-digitizers
GIT_REPOSITORY https://github.com/fair-acc/gr-digitizers.git
GIT_TAG 417f997f696f2bdaadfaf41ac7d8a339a95481be # dev-prototype as of 2024-04-05
GIT_TAG 0ad25d0d2947aac288cf76b1626816a5044b753e # dev-prototype as of 2024-04-25
)

FetchContent_MakeAvailable(gr-digitizers)
4 changes: 2 additions & 2 deletions src/ui/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ class App {
void handleMessages(FlowGraph &fg) final {
const auto available = _fromScheduler.streamReader().available();
if (available > 0) {
const auto messages = _fromScheduler.streamReader().get(available);
auto messages = _fromScheduler.streamReader().get(available);

for (const auto &msg : messages) {
fg.handleMessage(msg);
}
std::ignore = _fromScheduler.streamReader().consume(available);
std::ignore = messages.consume(available);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/ui/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ FetchContent_Declare( # needed to load images in ImGui
FetchContent_Declare(
opencmw-cpp
GIT_REPOSITORY https://github.com/fair-acc/opencmw-cpp.git
GIT_TAG c7236c423f4f1f4de8a762c1e946f6ad76cd0a8d # main as of 2024-03-13
GIT_TAG 0fb3758c3ffe7707aa5e0bd2ad25f9e8fb19f79d# main as of 2024-04-26
)

FetchContent_Declare(
graph-prototype
GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git
GIT_TAG 3cb5c2aff7046bc3760ccd8f8b701cbde361ecfd # main as of 2024-04-05
GIT_TAG 5e15e8478d267a5e74fdd3b310a7483a690fe1b4 # main as of 2024-04-25
)

FetchContent_MakeAvailable(imgui implot imgui-node-editor yaml-cpp stb opencmw-cpp plf_colony graph-prototype)
Expand Down
Loading