diff --git a/.codecov.yml b/.codecov.yml index 704156a9..ad4ae04b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -19,3 +19,8 @@ coverage: default: if_ci_failed: success # per default, codecov would fail if any CI fails informational: true # the codecov/patch status is never "fail" + only_pulls: true # only post codecov/patch status on PRs + +parsers: + cobertura: + partials_as_hits: true diff --git a/.github/workflows/ci_codeql.yml b/.github/workflows/ci_codeql.yml index a5896de5..17e4cbe2 100644 --- a/.github/workflows/ci_codeql.yml +++ b/.github/workflows/ci_codeql.yml @@ -30,15 +30,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 0 - submodules: true - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/ci_coverage.yml b/.github/workflows/ci_coverage.yml index 8fa984a1..17dad641 100644 --- a/.github/workflows/ci_coverage.yml +++ b/.github/workflows/ci_coverage.yml @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +# SPDX-FileCopyrightText: 2006-2023, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 name: Coverage @@ -23,96 +23,69 @@ env: defaults: run: - shell: bash -Eeuxo pipefail {0} + shell: bash -Eexuo pipefail {0} jobs: build: - name: ${{ matrix.name }} - runs-on: ubuntu-22.04 - timeout-minutes: 120 + runs-on: ubuntu-latest + name: ${{ matrix.compiler }} if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false matrix: - include: - - name: "gcc13" - compiler: "gcc-13" - build: coverage - build_type: Coverage - cxx_flags: "-std=c++23" - + compiler: ["gcc-14"] + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - # How many commits do we need to fetch to also fetch the branch point? - - name: Get fetch depth - id: fetch_depth - run: echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT - - name: Checkout uses: actions/checkout@v4 with: - path: raptor - fetch-depth: ${{ steps.fetch_depth.outputs.depth }} - submodules: true - - - name: Setup toolchain - uses: seqan/actions/setup-toolchain@main - with: - compiler: ${{ matrix.compiler }} - ccache_size: 525M + fetch-depth: 0 - - name: Install CMake - uses: seqan/actions/setup-cmake@main + - name: Load ccache + uses: actions/cache@v4 with: - cmake: 3.25.3 - - - name: Install gcovr - env: - CC: ${{ matrix.compiler }} - run: | - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100 - pip install gcovr==6.0 + path: /home/runner/.ccache + save-always: true + key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }} - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" \ - -DHIBF_NATIVE_BUILD=OFF - make -j2 gtest_main + mkdir build && cd build + cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage \ + -DCMAKE_CXX_FLAGS="-std=c++23 -Wno-interference-size" + make -j gtest_main - name: Build tests + working-directory: build run: | ccache -z - cd build - make -k -j2 + make -k -j ccache -sv - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure - name: Generate coverage report run: | - gcovr --gcov-executable ${{ github.workspace }}/raptor/.github/workflows/scripts/gcov.sh \ - --root ${{ github.workspace }}/raptor/test/coverage \ - ${{ github.workspace }}/build \ - --filter ${{ github.workspace }}/raptor/include \ - --filter ${{ github.workspace }}/raptor/src \ + gcovr --root ${GITHUB_WORKSPACE}/test/coverage \ + ${GITHUB_WORKSPACE}/build \ + --filter ${GITHUB_WORKSPACE}/raptor/include \ + --filter ${GITHUB_WORKSPACE}/raptor/src \ --exclude-lines-by-pattern '^\s*$' \ --exclude-lines-by-pattern '^\s*};$' \ - --exclude-lines-by-pattern '^.*GCOVR_EXCL_LINE.*$' \ --exclude-unreachable-branches \ --exclude-throw-branches \ --exclude-noncode-lines \ - -j 2 \ - --xml \ - --output ${{ github.workspace }}/build/coverage_report.xml + -j \ + --cobertura \ + --output ${GITHUB_WORKSPACE}/build/coverage_report.xml - name: Submit coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v3.1.5 with: - files: ${{ github.workspace }}/build/coverage_report.xml - root_dir: ${{ github.workspace }}/raptor + files: build/coverage_report.xml fail_ci_if_error: false diff --git a/.github/workflows/ci_documentation.yml b/.github/workflows/ci_documentation.yml index fcd4e725..c4e0c856 100644 --- a/.github/workflows/ci_documentation.yml +++ b/.github/workflows/ci_documentation.yml @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 name: Documentation @@ -14,35 +14,24 @@ on: workflow_dispatch: concurrency: - group: doc-${{ github.event.pull_request.number || github.ref }} + group: documentation-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name != 'push' }} env: - SHARG_NO_VERSION_CHECK: 1 TZ: Europe/Berlin defaults: run: - shell: bash -Eeuxo pipefail {0} + shell: bash -Eexuo pipefail {0} jobs: build: name: Documentation - runs-on: ubuntu-22.04 - timeout-minutes: 120 + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - name: Install Doxygen uses: seqan/actions/setup-doxygen@main @@ -51,12 +40,10 @@ jobs: - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/documentation - make -j2 download-cppreference-doxygen-web-tag + mkdir build && cd build + cmake ../test/documentation + make -j download-cppreference-doxygen-web-tag - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_fortify.yml b/.github/workflows/ci_fortify.yml index 466887f8..cfe8ddfa 100644 --- a/.github/workflows/ci_fortify.yml +++ b/.github/workflows/ci_fortify.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: concurrency: - group: fortify-${{ github.ref }} + group: fortify-actions cancel-in-progress: true env: @@ -23,55 +23,38 @@ defaults: jobs: build: - name: ${{ matrix.name }} ${{ matrix.build_type }} - runs-on: ubuntu-22.04 - timeout-minutes: 240 + name: Fortify ${{ matrix.build_type }} + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: include: - - name: "Fortify" - build_type: Release + - build_type: Release cxx_flags: "-fcf-protection=check" - - name: "Fortify" - build_type: Debug + - build_type: Debug cxx_flags: "-fcf-protection=full" - + container: + image: ghcr.io/seqan/gcc-14 + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 1 - submodules: true - - - name: Setup compiler - uses: seqan/actions/setup-compiler@main - with: - compiler: gcc-13 - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="-std=c++23 -fexceptions -g -grecord-gcc-switches -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -mtune=native -fasynchronous-unwind-tables -fstack-clash-protection -Wno-interference-size ${{ matrix.cxx_flags }}" - make -j2 gtest_main + mkdir build && cd build + cmake ../test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_FLAGS="-std=c++23 -fexceptions -g -grecord-gcc-switches -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -mtune=native -fasynchronous-unwind-tables -fstack-clash-protection -Wno-interference-size ${{ matrix.cxx_flags }}" + make -j gtest_main - name: Build tests - run: | - cd build - make -k -j2 + working-directory: build + run: make -k -j - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_license.yml b/.github/workflows/ci_license.yml index 2103a620..9c4a8d6f 100644 --- a/.github/workflows/ci_license.yml +++ b/.github/workflows/ci_license.yml @@ -23,8 +23,7 @@ env: jobs: check: name: REUSE Compliance - runs-on: ubuntu-22.04 - timeout-minutes: 120 + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' steps: - name: Checkout diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux.yml index 4771b587..176831f6 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux.yml @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -name: Linux +name: Unit on: push: @@ -23,85 +23,54 @@ env: defaults: run: - shell: bash -Eeuxo pipefail {0} + shell: bash -Eexuo pipefail {0} jobs: build: - name: ${{ matrix.name }} - runs-on: ubuntu-22.04 - timeout-minutes: 120 + runs-on: ubuntu-latest + name: ${{ matrix.compiler }} if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false matrix: + compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11", "intel"] include: - - name: "clang17" - compiler: "clang-17" - build: unit - build_type: Release + - cxx_flags: "-std=c++23 -Wno-interference-size" + - compiler: "clang-18" + cxx_flags: "-std=c++23" + - compiler: "clang-17" cxx_flags: "-std=c++20" - - - name: "gcc13" - compiler: "gcc-13" - build: unit - build_type: Release - cxx_flags: "-std=c++23 -Wno-interference-size" - - - name: "gcc12" - compiler: "gcc-12" - build: unit - build_type: Release - cxx_flags: "-std=c++23 -Wno-interference-size" - - - name: "gcc11" - compiler: "gcc-11" - build: unit - build_type: Release - cxx_flags: "-std=c++23 -Wno-interference-size" - - - name: "IntelLLVM" - compiler: "intel" - build: unit - build_type: Release - cxx_flags: "-fp-model=strict -Wno-overriding-option" # Ignore that googletest sets -fp-model=precise - + - compiler: "intel" + cxx_flags: "-std=c++20 -fp-model=strict -Wno-overriding-option" + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - - - name: Setup toolchain - uses: seqan/actions/setup-toolchain@main - with: - compiler: ${{ matrix.compiler }} - ccache_size: 150M - - name: Install CMake - uses: seqan/actions/setup-cmake@main + - name: Load ccache + uses: actions/cache@v4 with: - cmake: 3.25.3 + path: /home/runner/.ccache + save-always: true + key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }} - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \ - -DHIBF_NATIVE_BUILD=OFF - make -j2 gtest_main + mkdir build && cd build + cmake ../test/unit -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" + make -j gtest_main - name: Build tests + working-directory: build run: | ccache -z - cd build - make -k -j2 + make -k -j ccache -sv - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 453cb8a6..53d3d2f0 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 name: macOS @@ -23,72 +23,52 @@ env: defaults: run: - shell: bash -Eeuxo pipefail {0} + shell: bash -Eexuo pipefail {0} jobs: build: - name: ${{ matrix.name }} + name: ${{ matrix.compiler }} runs-on: macos-12 - timeout-minutes: 120 if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false matrix: + compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11"] include: - - name: "gcc13" - compiler: "gcc-13" - build: unit - build_type: Release + - cxx_flags: "-std=c++23 -Wno-interference-size" + - compiler: "clang-18" cxx_flags: "-std=c++23" - - - name: "gcc12" - compiler: "gcc-12" - build: unit - build_type: Release - cxx_flags: "-std=c++23" - - - name: "gcc11" - compiler: "gcc-11" - build: unit - build_type: Release - cxx_flags: "-std=c++23" - + - compiler: "clang-17" + cxx_flags: "-std=c++20" steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - name: Setup toolchain uses: seqan/actions/setup-toolchain@main with: compiler: ${{ matrix.compiler }} - ccache_size: 150M + ccache_size: 75M - name: Install CMake uses: seqan/actions/setup-cmake@main with: - cmake: 3.25.3 + cmake: 3.28.5 - name: Configure tests run: | mkdir build cd build - cmake ../raptor/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" \ - -DHIBF_NATIVE_BUILD=OFF - make -j2 gtest_main + cmake ../test/unit -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" + make -j gtest_main - name: Build tests + working-directory: build run: | ccache -z - cd build - make -k -j3 + make -k -j ccache -sv - name: Run tests - run: | - cd build - ctest . -j3 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_misc.yml b/.github/workflows/ci_misc.yml index 7aac17f1..e5decea2 100644 --- a/.github/workflows/ci_misc.yml +++ b/.github/workflows/ci_misc.yml @@ -28,79 +28,77 @@ defaults: jobs: build: name: ${{ matrix.name }} - runs-on: ubuntu-22.04 - timeout-minutes: 120 + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false matrix: include: - - name: "Snippet gcc13" - compiler: "gcc-13" - cxx_flags: "-std=c++23" - build_type: Release + - name: "Snippet clang17" + compiler: "clang-17" build: snippet - - name: "Performance gcc13" - compiler: "gcc-13" - cxx_flags: "-std=c++23" - build_type: Release + - name: "Snippet gcc11" + compiler: "gcc-11" + build: snippet + cxx_flags: "-std=c++23 -Wno-interference-size" + + - name: "Performance clang17" + compiler: "clang-17" build: performance - - name: "Header gcc13" - compiler: "gcc-13" - cxx_flags: "-std=c++23" - build_type: Release + - name: "Performance gcc11" + compiler: "gcc-11" + build: performance + cxx_flags: "-std=c++23 -Wno-interference-size" + + - name: "Header clang17" + compiler: "clang-17" build: header + - name: "Header gcc14" + compiler: "gcc-14" + build: header + cxx_flags: "-std=c++23 -Wno-interference-size" + - name: "Header gcc11" compiler: "gcc-11" - cxx_flags: "-std=c++23" - build_type: Release build: header - + cxx_flags: "-std=c++23 -Wno-interference-size" + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - - name: Setup toolchain - uses: seqan/actions/setup-toolchain@main + - name: Load ccache + uses: actions/cache@v4 with: - compiler: ${{ matrix.compiler }} - ccache_size: 150M - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 + path: /home/runner/.ccache + save-always: true + key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }} - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" \ - -DHIBF_NATIVE_BUILD=OFF + mkdir build && cd build + cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" case "${{ matrix.build }}" in - snippet) make -j${{ matrix.build_threads }} gtest_main;; - performance) make -j${{ matrix.build_threads }} benchmark_main;; - header) make -j${{ matrix.build_threads }} gtest_main benchmark_main;; + snippet) make -j gtest_main;; + performance) make -j benchmark_main;; + header) make -j gtest_main benchmark_main;; esac - name: Build tests + working-directory: build env: CMAKE_BUILD_PARALLEL_LEVEL: 2 run: | ccache -z - cd build - make -k -j2 + make -k -j ccache -sv - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_sanitizer.yml b/.github/workflows/ci_sanitizer.yml index f7c09d31..51c76dd5 100644 --- a/.github/workflows/ci_sanitizer.yml +++ b/.github/workflows/ci_sanitizer.yml @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 name: Sanitizer @@ -10,13 +10,12 @@ on: workflow_dispatch: concurrency: - group: sanitizer-${{ github.ref }} + group: sanitizer-actions cancel-in-progress: true env: - SHARG_NO_VERSION_CHECK: 1 TZ: Europe/Berlin - ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 + ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1 TSAN_OPTIONS: ignore_noninstrumented_modules=1 UBSAN_OPTIONS: print_stacktrace=1 @@ -26,72 +25,71 @@ defaults: jobs: build: - name: ${{ matrix.name }} ${{ matrix.build_type }} - runs-on: ubuntu-22.04 - timeout-minutes: 240 + name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: - name: [AddressSanitizer, ThreadSanitizer, UndefinedBehaviorSanitizer] - build_type: [Release, Debug] + name: [ASan, TSan, UBSan] + os: [ubuntu-latest, macos-12] + build_type: [Release, RelWithDebInfo, Debug] + exclude: + - name: "TSan" + os: macos-12 include: - - name: "AddressSanitizer" - compiler: gcc-13 - cxx_flags: "-std=c++23 -fno-omit-frame-pointer -fsanitize=address -Wno-maybe-uninitialized -Wno-interference-size" - - - name: "ThreadSanitizer" - compiler: clang-17 - cxx_flags: "-std=c++20 -fno-omit-frame-pointer -fsanitize=thread" - - - name: "UndefinedBehaviorSanitizer" - compiler: gcc-13 - cxx_flags: "-std=c++23 -fno-omit-frame-pointer -fsanitize=undefined -Wno-interference-size" - + - name: "ASan" + cxx_flags: "-fno-omit-frame-pointer -fsanitize=address" + + - name: "TSan" + cxx_flags: "-fno-omit-frame-pointer -fsanitize=thread" + + - name: "UBSan" + os: macos-12 + cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero,implicit-conversion,local-bounds,nullability -Wno-pass-failed" + + - name: "UBSan" + os: ubuntu-latest + cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero" + + - os: macos-12 + compiler: clang-18 + + - os: ubuntu-latest + compiler: gcc-14 + image: ghcr.io/seqan/gcc-14 + cxx_ubuntu: "-Wno-interference-size" + + - name: "TSan" + os: ubuntu-latest + compiler: clang-18 + image: ghcr.io/seqan/clang-18 + container: + image: ${{ matrix.image || '' }} + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 1 - submodules: true - name: Setup compiler + if: contains(matrix.os, 'macos') uses: seqan/actions/setup-compiler@main with: compiler: ${{ matrix.compiler }} - - name: Install OpenMP - if: contains(matrix.compiler, 'clang') - run: | - install libomp-17-dev - echo "OMP_TOOL_LIBRARIES=/usr/lib/llvm-17/lib/libarcher.so" >> "$GITHUB_ENV" - - - name: Configure OS - run: | - sudo bash -c "echo 0 > /proc/sys/vm/overcommit_memory" - sudo bash -c "echo 2 >/proc/sys/kernel/randomize_va_space" - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" - make -j2 gtest_main + mkdir build && cd build + cmake ../test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} ${{ matrix.cxx_ubuntu }}" + make -j gtest_main - name: Build tests - run: | - cd build - make -k -j2 + working-directory: build + run: make -k -j - name: Run tests - run: | - cd build - ctest . -j2 --output-on-failure + working-directory: build + run: ctest . -j --output-on-failure diff --git a/.github/workflows/ci_utility.yml b/.github/workflows/ci_utility.yml index 6dcbaa4f..58b8ee01 100644 --- a/.github/workflows/ci_utility.yml +++ b/.github/workflows/ci_utility.yml @@ -27,59 +27,39 @@ defaults: jobs: build: - name: ${{ matrix.name }} - runs-on: ubuntu-22.04 - timeout-minutes: 120 + name: ${{ matrix.compiler }} + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false matrix: + compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11", "intel"] include: - - name: "gcc13" - compiler: "gcc-13" - build_type: Release + - cxx_flags: "-std=c++23 -Wno-interference-size" + - compiler: "clang-18" cxx_flags: "-std=c++23" - - - name: "gcc12" - compiler: "gcc-12" - build_type: Release - cxx_flags: "-std=c++23" - - - name: "gcc11" - compiler: "gcc-11" - build_type: Release - cxx_flags: "-std=c++23" - + - compiler: "clang-17" + cxx_flags: "-std=c++20" + - compiler: "intel" + cxx_flags: "-std=c++20 -fp-model=strict -Wno-overriding-option" + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - - - name: Setup toolchain - uses: seqan/actions/setup-toolchain@main - with: - compiler: ${{ matrix.compiler }} - ccache_size: 150M - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - name: Configure tests run: | - mkdir build - cd build - cmake ../raptor/util/test -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" + mkdir build && cd build + cmake ../util/test -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" - name: Build tests + working-directory: build run: | ccache -z - cd build - make -k -j2 + make -k -j ccache -sv diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 63556a2a..73d0589b 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -36,72 +36,54 @@ jobs: matrix: include: - name: "Nextflow" - compiler: "gcc-13" - build_type: Release - cxx_flags: "-std=c++23" - + compiler: "gcc-14" - name: "CWL" - compiler: "gcc-13" - build_type: Release - cxx_flags: "-std=c++23" + compiler: "gcc-14" + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - name: Checkout uses: actions/checkout@v4 - with: - path: raptor - fetch-depth: 2 - submodules: true - - - name: Setup toolchain - uses: seqan/actions/setup-toolchain@main - with: - compiler: ${{ matrix.compiler }} - ccache_size: 150M - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.25.3 - name: Install Nextflow if: matrix.name == 'Nextflow' - uses: nf-core/setup-nextflow@v2 - with: - version: latest-stable + working-directory: /usr/local/bin + run: | + apt-get update + apt-get install --yes default-jre-headless + curl -s https://get.nextflow.io | bash - name: Install cwltool if: matrix.name == 'CWL' run: | - install pipx - pipx install cwltool + apt-get update + apt-get install --yes cwltool - name: Configure Raptor run: | - mkdir build - cd build - cmake ../raptor -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" \ - -DHIBF_NATIVE_BUILD=OFF + mkdir build && cd build + cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-std=c++23 -Wno-interference-size" - name: Build Raptor + working-directory: build run: | ccache -z - cd build - make -k -j2 + make -k -j make install ccache -sv - name: Run Nextflow if: matrix.name == 'Nextflow' - run: | - cd raptor/workflow/nextflow - nextflow hibf.nf + working-directory: workflow/nextflow + run: nextflow hibf.nf - name: Run cwltool if: matrix.name == 'CWL' run: | raptor build --export-help cwl > raptor.cwl cwltool --validate raptor.cwl - cwltool raptor.cwl raptor/workflow/cwl/tests/raptor-build-0_bins_window_19.yml - cwltool raptor.cwl raptor/workflow/cwl/tests/raptor-build-16_bins_window_19.yml + cwltool raptor.cwl workflow/cwl/tests/raptor-build-0_bins_window_19.yml + cwltool raptor.cwl workflow/cwl/tests/raptor-build-16_bins_window_19.yml diff --git a/.github/workflows/scripts/gcov.sh b/.github/workflows/scripts/gcov.sh deleted file mode 100755 index 6883a89d..00000000 --- a/.github/workflows/scripts/gcov.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin -# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik -# SPDX-License-Identifier: CC0-1.0 - -set -Eeuo pipefail - -args=${@/--branch-counts/""} -args=${args/--branch-probabilities/""} - -exec gcov $args diff --git a/cmake/configuration.cmake b/cmake/configuration.cmake index fbad45c1..d7b9fd3e 100644 --- a/cmake/configuration.cmake +++ b/cmake/configuration.cmake @@ -42,6 +42,12 @@ CPMUsePackageLock (${Raptor_SOURCE_DIR}/cmake/package-lock.cmake) # Find or add dependencies # ---------------------------------------------------------------------------- +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18 + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19 +) + add_compile_definitions (_LIBCPP_CHAR_TRAITS_REMOVE_BASE_SPECIALIZATION) +endif () CPMGetPackage (use_ccache) CPMGetPackage (hibf) CPMGetPackage (sharg) diff --git a/cmake/package-lock.cmake b/cmake/package-lock.cmake index 38634874..0401697b 100644 --- a/cmake/package-lock.cmake +++ b/cmake/package-lock.cmake @@ -6,7 +6,7 @@ # This file should be committed to version control # hibf -set (RAPTOR_HIBF_VERSION 95c686c2a4147a364231aaeae88adbe93ce83181) +set (RAPTOR_HIBF_VERSION 187a9121be5cb81ddfd9f3c72332382f401c28dc) CPMDeclarePackage (hibf NAME hibf GIT_TAG ${RAPTOR_HIBF_VERSION} @@ -16,7 +16,7 @@ CPMDeclarePackage (hibf OPTIONS "INSTALL_HIBF OFF" ) # sharg -set (RAPTOR_SHARG_VERSION 39f65a4890f8c5108af2b5c7974893ff6ed87e50) +set (RAPTOR_SHARG_VERSION 467d5f7d460012e4b5e0970463fb9ddf9afafae1) CPMDeclarePackage (sharg NAME sharg GIT_TAG ${RAPTOR_SHARG_VERSION} @@ -26,7 +26,7 @@ CPMDeclarePackage (sharg OPTIONS "INSTALL_SHARG OFF" "INSTALL_TDL OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING" ) # seqan3 -set (RAPTOR_SEQAN3_VERSION f489f67d9aaa6e72dc42c59a1e5ef8fc27fec9d6) +set (RAPTOR_SEQAN3_VERSION 21c7d04fb74151d6a01e74203eff0712d42ed190) CPMDeclarePackage (seqan3 NAME seqan3 GIT_TAG ${RAPTOR_SEQAN3_VERSION} @@ -36,7 +36,7 @@ CPMDeclarePackage (seqan3 OPTIONS "INSTALL_SEQAN3 OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING" ) # chopper -set (RAPTOR_CHOPPER_VERSION 4ff191e21def35cfd69e0242046f4b5188017a53) +set (RAPTOR_CHOPPER_VERSION 40b79a02a44d66bc0bd98d50e731a93ab38e96f5) CPMDeclarePackage (chopper NAME chopper GIT_TAG ${RAPTOR_CHOPPER_VERSION} diff --git a/include/raptor/search/load_index.hpp b/include/raptor/search/load_index.hpp index 4f6ade62..7f99db47 100644 --- a/include/raptor/search/load_index.hpp +++ b/include/raptor/search/load_index.hpp @@ -10,6 +10,7 @@ #pragma once #include +#include #include #include diff --git a/include/raptor/threshold/logspace.hpp b/include/raptor/threshold/logspace.hpp index 1a729b4f..f2fe3999 100644 --- a/include/raptor/threshold/logspace.hpp +++ b/include/raptor/threshold/logspace.hpp @@ -9,6 +9,7 @@ #pragma once +#include #include namespace raptor::logspace diff --git a/src/prepare/compute_minimiser.cpp b/src/prepare/compute_minimiser.cpp index 7e52298b..abbc379f 100644 --- a/src/prepare/compute_minimiser.cpp +++ b/src/prepare/compute_minimiser.cpp @@ -105,7 +105,7 @@ void compute_minimiser(prepare_arguments const & arguments) { if (occurrences >= cutoff) { - outfile.write(reinterpret_cast(&hash), sizeof(hash)); + outfile.write(reinterpret_cast(&hash), sizeof(hash)); ++count; } } diff --git a/test/performance/bin_influence_benchmark.cpp b/test/performance/bin_influence_benchmark.cpp index b7921a54..593d7b77 100644 --- a/test/performance/bin_influence_benchmark.cpp +++ b/test/performance/bin_influence_benchmark.cpp @@ -155,7 +155,7 @@ static void bulk_count(benchmark::State & state, double && fpr) { try { - ibf = std::move(construct_ibf(bin_count, hash_adaptor, fpr)); + ibf = construct_ibf(bin_count, hash_adaptor, fpr); std::ofstream os{index_path, std::ios::binary}; cereal::BinaryOutputArchive oarchive{os}; oarchive(ibf); diff --git a/test/raptor-test.cmake b/test/raptor-test.cmake index acecca14..182747c5 100644 --- a/test/raptor-test.cmake +++ b/test/raptor-test.cmake @@ -53,10 +53,12 @@ enable_testing () add_library (raptor_test INTERFACE) target_compile_options (raptor_test INTERFACE "-pedantic" "-Wall" "-Wextra" "-Werror") # GCC12 and above: Disable warning about std::hardware_destructive_interference_size not being ABI-stable. -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) - target_compile_options (raptor_test INTERFACE "-Wno-interference-size") - endif () +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) + target_compile_options (raptor_test INTERFACE "-Wno-interference-size") +endif () +# std::views::join is experimental in LLVM 17 +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18) + target_compile_definitions (raptor_test INTERFACE "_LIBCPP_ENABLE_EXPERIMENTAL") endif () target_link_libraries (raptor_test INTERFACE "raptor_lib") target_include_directories (raptor_test INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include") @@ -92,6 +94,7 @@ add_library (raptor::test::unit ALIAS raptor_test_unit) add_library (raptor_test_header INTERFACE) target_link_libraries (raptor_test_header INTERFACE "raptor::test::unit") target_link_libraries (raptor_test_header INTERFACE "raptor::test::performance") +target_compile_options (raptor_test_header INTERFACE "-Wno-unused-function" "-Wno-unused-const-variable") add_library (raptor::test::header ALIAS raptor_test_header) # ---------------------------------------------------------------------------- diff --git a/test/unit/api/threshold.cpp b/test/unit/api/threshold.cpp index 637c5563..012afb46 100644 --- a/test/unit/api/threshold.cpp +++ b/test/unit/api/threshold.cpp @@ -118,7 +118,7 @@ TEST(minimiser, logspace_substract) 10u, 11u, 12u, 13u, 13u, 14u, 15u, 16u, 17u, 18u, 20u, 21u}; ASSERT_EQ(expected.size(), 37u - 12u); for (size_t i = 12u; i < 37u; ++i) - EXPECT_EQ(threshold.get(i), expected[i - 12u]); + EXPECT_EQ(threshold.get(i), expected[i - 12u]) << i; } TEST(percentage, 100) diff --git a/util/applications/src/Genome_Biology/compare_to_truth.cpp b/util/applications/src/Genome_Biology/compare_to_truth.cpp index fd3d811e..735ea7af 100644 --- a/util/applications/src/Genome_Biology/compare_to_truth.cpp +++ b/util/applications/src/Genome_Biology/compare_to_truth.cpp @@ -332,7 +332,7 @@ class thresholder { private: // size_t const destroyed_kmers{}; - double const percentage{}; + double percentage{}; public: thresholder() = default; @@ -342,7 +342,7 @@ class thresholder thresholder & operator=(thresholder &&) = default; ~thresholder() = default; - explicit thresholder(double perc) : percentage(perc) + explicit thresholder(double const perc) : percentage(perc) {} [[nodiscard]] constexpr size_t get(size_t const kmer_count) const noexcept diff --git a/util/applications/src/iScience/generate_reads.cpp b/util/applications/src/iScience/generate_reads.cpp index d0322840..361dca51 100644 --- a/util/applications/src/iScience/generate_reads.cpp +++ b/util/applications/src/iScience/generate_reads.cpp @@ -58,7 +58,6 @@ void run_program(config const & cfg) seqan3::sequence_file_input> fin{bin_file}; seqan3::sequence_file_output fout{(cfg.out_dir / bin_file.filename()).replace_extension(".fastq")}; - uint16_t haplotype_counter{}; uint32_t reads_per_bin_counter{}; for (auto && record : fin) @@ -79,7 +78,6 @@ void run_program(config const & cfg) fout.emplace_back(read, std::to_string(read_counter), quality); } - ++haplotype_counter; } } } diff --git a/util/applications/src/iScience/generate_reads_refseq.cpp b/util/applications/src/iScience/generate_reads_refseq.cpp index 00746fd2..12b19901 100644 --- a/util/applications/src/iScience/generate_reads_refseq.cpp +++ b/util/applications/src/iScience/generate_reads_refseq.cpp @@ -82,8 +82,16 @@ void run_program(cmd_arguments const & arguments) auto worker = [&](auto && zipped_view, auto &&) { + // https://godbolt.org/z/PeKnxzjn1 +#if defined(__clang__) + for (auto && zipped : zipped_view) + { + auto bin_file = std::move(std::get<0>(zipped)); + auto bin_number = std::move(std::get<1>(zipped)); +#else for (auto && [bin_file, bin_number] : zipped_view) { +#endif std::mt19937_64 rng(bin_number); uint32_t read_counter{bin_number * reads_per_bin}; // Immediately invoked initialising lambda expession (IIILE).