Fix flaky scheduler-message-passing-related unit test #3340
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: main CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| jobs: | |
| buildAndPublishDocker: | |
| name: "Update the docker container if it is modified" | |
| runs-on: "ubuntu-latest" | |
| outputs: | |
| container: ${{ steps.docker-label.outputs.label }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| if: github.event_name == 'push' | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if dockerfile was modified | |
| id: changes | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| docker: | |
| - 'docker/Dockerfile' | |
| - name: Set up Docker Label | |
| id: docker-label | |
| run: | | |
| if [ "${{ steps.changes.outputs.docker == 'true' && github.event_name != 'push' }}" = "true" ]; then | |
| echo "label=ghcr.io/fair-acc/gr4-build-container:${GITHUB_HEAD_REF/\//-}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "label=ghcr.io/fair-acc/gr4-build-container:latest" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set up Docker Buildx | |
| if: steps.changes.outputs.docker == 'true' | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| if: steps.changes.outputs.docker == 'true' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/build-push-action@v6 | |
| if: steps.changes.outputs.docker == 'true' | |
| with: | |
| context: "{{defaultContext}}:docker" | |
| push: true | |
| tags: ${{ steps.docker-label.outputs.label }} | |
| build: | |
| name: "${{ matrix.compiler.label || matrix.compiler.cc }} | ${{ matrix.cmake-build-type }}" | |
| needs: buildAndPublishDocker | |
| runs-on: "ubuntu-latest" | |
| concurrency: | |
| # Cancel running builds inside work (PR) branches, build all revisions for the main branch | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.compiler.label || matrix.compiler.cc }}-${{ matrix.cmake-build-type }} | |
| cancel-in-progress: true | |
| container: | |
| image: "${{ needs.buildAndPublishDocker.outputs.container }}" | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_BASEDIR: ${{ github.workspace }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: | |
| - cc: gcc-14 | |
| cxx: g++-14 | |
| cmake_flags: "-DADDRESS_SANITIZER=ON" | |
| - cc: gcc-15 | |
| cxx: g++-15 | |
| cmake_flags: "-DADDRESS_SANITIZER=ON" | |
| - cc: clang-20 | |
| cxx: clang++-20 | |
| cmake_flags: "-DADDRESS_SANITIZER=ON" | |
| - label: "AdaptiveCpp" | |
| cc: clang-20 | |
| cxx: acpp | |
| cmake_flags: "-DADDRESS_SANITIZER=OFF -DUB_SANITIZER=OFF -DTHREAD_SANITIZER=OFF" | |
| - cmake_wrapper: emcmake | |
| cc: emcc | |
| cmake_flags: "-DENABLE_COVERAGE=OFF -DCMAKE_CROSSCOMPILING_EMULATOR=${SYSTEM_NODE} -DGNURADIO_PARSE_REGISTRATIONS_TOOL_CXX_COMPLILER=g++-14" | |
| cmake-build-type: [ Release, Debug ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/.ccache | |
| key: ccache-${{ runner.os }}-${{ matrix.compiler.label || matrix.compiler.cc }}-${{ matrix.cmake-build-type }}-${{ github.sha }} | |
| restore-keys: | | |
| ccache-${{ runner.os }}-${{ matrix.compiler.label || matrix.compiler.cc }}-${{ matrix.cmake-build-type }} | |
| - name: Configure ccache | |
| run: | | |
| ccache --max-size=3G | |
| ccache --set-config=compression=true | |
| ccache --set-config=compression_level=6 | |
| ccache --set-config=depend_mode=true | |
| ccache --set-config=hash_dir=false | |
| ccache --set-config=sloppiness=file_macro,time_macros,include_file_mtime,include_file_ctime | |
| ccache -z | |
| ccache --show-stats | |
| - name: Cache fetchContent | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-fetchContent-cache | |
| with: | |
| path: ${{runner.workspace}}/build/_deps | |
| key: fetchContent-${{ runner.os }}-${{ matrix.compiler.label || matrix.compiler.cc }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }} | |
| restore-keys: | | |
| fetchContent-${{ runner.os }}-${{ matrix.compiler.label || matrix.compiler.cc }}-${{ matrix.cmake-build-type }} | |
| fetchContent-${{ runner.os }}-${{ matrix.compiler.label || matrix.compiler.cc }} | |
| - name: Configure | |
| if: matrix.compiler.cmake_wrapper == null && matrix.compiler.cxx != 'acpp' | |
| shell: bash | |
| env: | |
| CC: "${{ matrix.compiler.cc }}" | |
| CXX: "${{ matrix.compiler.cxx }}" | |
| CMAKE_EXPORT_COMPILE_COMMANDS: "ON" | |
| run: | | |
| cmake -S . -B ../build -DCMAKE_COLOR_DIAGNOSTICS=ON -DDISABLE_EXTERNAL_DEPS_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DUSE_CCACHE=ON -DENABLE_COVERAGE=OFF ${{ matrix.compiler.cmake_flags }} | |
| - name: Configure AdaptiveCpp | |
| if: matrix.compiler.cxx == 'acpp' | |
| shell: bash | |
| env: | |
| CC: "${{ matrix.compiler.cc }}" | |
| CXX: "${{ matrix.compiler.cxx }}" | |
| CMAKE_EXPORT_COMPILE_COMMANDS: "ON" | |
| ACPP_TARGETS: omp | |
| run: | | |
| which acpp | |
| acpp --version | |
| cmake -S . -B ../build -DCMAKE_COLOR_DIAGNOSTICS=ON -DDISABLE_EXTERNAL_DEPS_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DUSE_CCACHE=ON -DENABLE_COVERAGE=OFF ${{ matrix.compiler.cmake_flags }} | |
| - name: Configure CMake Emscripten | |
| if: matrix.compiler.cmake_wrapper == 'emcmake' | |
| shell: bash | |
| run: | | |
| export SYSTEM_NODE=`which node` # use system node instead of old version distributed with emsdk | |
| $EMSDK_HOME/emsdk activate $EMSDK_VERSION | |
| source $EMSDK_HOME/emsdk_env.sh | |
| ${{ matrix.compiler.cmake_wrapper }} cmake -S . -B ../build \ | |
| -DCMAKE_COLOR_DIAGNOSTICS=ON \ | |
| -DDISABLE_EXTERNAL_DEPS_WARNINGS=ON \ | |
| -DUSE_CCACHE=ON \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} \ | |
| ${{ matrix.compiler.cmake_flags }} | |
| - name: Build | |
| shell: bash | |
| run: | | |
| test -f $EMSDK_HOME/emsdk_env.sh && source $EMSDK_HOME/emsdk_env.sh | |
| if [ "${{ matrix.compiler.cxx }}" = "acpp" ]; then export ACPP_TARGETS=omp; fi | |
| cmake --build ../build | |
| - name: execute tests | |
| if: matrix.compiler.cc != 'gcc-14' || matrix.cmake-build-type != 'Debug' | |
| env: | |
| DISABLE_SENSITIVE_TESTS: 1 # disables tests which are sensitive to execution speed and will not run with instrumented code | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ctest --output-on-failure | |
| - name: execute native main binary | |
| if: matrix.compiler.cmake_wrapper == null | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ./core/src/main | |
| - name: execute wasm main binary with nodejs | |
| if: matrix.compiler.cmake_wrapper != null | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: node ./core/src/main.js | |
| - name: Show final ccache and build directory stats | |
| if: always() | |
| continue-on-error: true | |
| run: | | |
| ccache --show-stats | |
| echo "--- Build directory ---" | |
| du -sh ../build | |
| echo "--- Object files (.o) ---" | |
| find ../build -name "*.o" -exec du -ch {} + | tail -1 | |
| echo "--- Archives (.a) ---" | |
| find ../build -name "*.a" -exec du -ch {} + | tail -1 | |
| coverage: | |
| name: "GCC-14 Coverage" | |
| needs: buildAndPublishDocker | |
| runs-on: ubuntu-latest | |
| container: | |
| image: "${{ needs.buildAndPublishDocker.outputs.container }}" | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_BASEDIR: ${{ github.workspace }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/.ccache | |
| key: ccache-coverage-gcc14-debug-${{ github.sha }} | |
| restore-keys: | | |
| ccache-coverage-gcc14-debug | |
| - name: Configure ccache | |
| run: | | |
| ccache --max-size=3G | |
| ccache --set-config=compression=true | |
| ccache --set-config=compression_level=6 | |
| ccache --set-config=depend_mode=true | |
| ccache --set-config=hash_dir=false | |
| ccache --set-config=sloppiness=file_macro,time_macros,include_file_mtime,include_file_ctime | |
| ccache -z | |
| ccache --show-stats | |
| - name: Configure (coverage) | |
| shell: bash | |
| env: | |
| CC: gcc-14 | |
| CXX: g++-14 | |
| CMAKE_EXPORT_COMPILE_COMMANDS: "ON" | |
| run: | | |
| cmake -S . -B ../build \ | |
| -DCMAKE_COLOR_DIAGNOSTICS=ON \ | |
| -DDISABLE_EXTERNAL_DEPS_WARNINGS=ON \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DUSE_CCACHE=ON \ | |
| -DENABLE_COVERAGE=ON \ | |
| -DADDRESS_SANITIZER=OFF | |
| - name: Build | |
| run: cmake --build ../build | |
| - name: Execute tests | |
| env: | |
| DISABLE_SENSITIVE_TESTS: 1 # disables tests which are sensitive to execution speed and will not run with instrumented code | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ctest --output-on-failure | |
| - name: Generate coverage report | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: cmake --build . --target coverage | |
| - name: Run sonar-scanner | |
| shell: bash | |
| env: | |
| SONAR_HOST_URL: https://sonarcloud.io | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: sonar-scanner | |
| - name: Show final ccache and build directory stats | |
| if: always() | |
| continue-on-error: true | |
| run: | | |
| ccache --show-stats | |
| echo "--- Build directory ---" | |
| du -sh ../build | |
| echo "--- Object files (.o) ---" | |
| find ../build -name "*.o" -exec du -ch {} + | tail -1 | |
| echo "--- Archives (.a) ---" | |
| find ../build -name "*.a" -exec du -ch {} + | tail -1 |