diff --git a/.github/workflows/cron_latest_libraries.yml b/.github/workflows/cron_latest_libraries.yml new file mode 100644 index 00000000..259204ec --- /dev/null +++ b/.github/workflows/cron_latest_libraries.yml @@ -0,0 +1,61 @@ +# SPDX-FileCopyrightText: 2006-2026 Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2026 Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + +name: Latest Libraries + +on: + schedule: + - cron: "0 4 * * SUN" + workflow_dispatch: + +concurrency: + group: libs-actions + cancel-in-progress: true + +env: + SHARG_NO_VERSION_CHECK: 1 + TZ: Europe/Berlin + +defaults: + run: + shell: bash -Eexuo pipefail {0} + +jobs: + build: + name: ${{ matrix.build }} ${{ matrix.compiler }} + runs-on: ubuntu-latest + timeout-minutes: 300 + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' + strategy: + fail-fast: false + matrix: + compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest", "intel"] + build: [unit, snippet, header] + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Update dependencies + run: | + FILE="cmake/package-lock.cmake" + sed -i -E 's@(set \(SHARG_\S+_VERSION )[^\)]+\)@\1main)@g' $FILE + sed -i -E 's@VERSION( \$\{SHARG_\S+_VERSION\})@GIT_TAG\1@g' $FILE + cat $FILE + + - name: Configure tests + run: | + mkdir build && cd build + cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=Release + make gtest_main yaml-cpp + + - name: Build tests + working-directory: build + run: | + make -k + + - name: Run tests + working-directory: build + run: ctest . -j${{ matrix.build == 'snippet' && '1' || '' }} --output-on-failure --no-tests=error diff --git a/.github/workflows/cron_sanitizer.yml b/.github/workflows/cron_sanitizer.yml new file mode 100644 index 00000000..51ab225f --- /dev/null +++ b/.github/workflows/cron_sanitizer.yml @@ -0,0 +1,107 @@ +# SPDX-FileCopyrightText: 2006-2026, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2026, Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + +name: Sanitizer + +on: + schedule: + - cron: "0 6 * * SAT" + workflow_dispatch: + +concurrency: + group: sanitizer-actions + cancel-in-progress: true + +env: + SHARG_NO_VERSION_CHECK: 1 + TZ: Europe/Berlin + TSAN_OPTIONS: ignore_noninstrumented_modules=1 + UBSAN_OPTIONS: print_stacktrace=1 + +defaults: + run: + shell: bash -Eeuxo pipefail {0} + +jobs: + build: + name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' + env: + ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=${{ contains(matrix.os, 'macos') && '0' || '1' }} + strategy: + fail-fast: false + matrix: + name: [ASan, TSan, UBSan] + os: [ubuntu-latest, macos-latest] + build_type: [Release, RelWithDebInfo, Debug] + exclude: + # macOS llvm packages do not contain libarcher, which is required for TSan to handle OpenMP. + # TSan runs on ubuntu with clang. Packages there contain libarcher. + - name: "TSan" + os: macos-latest + + include: + - os: macos-latest + compiler: clang-latest + - os: ubuntu-latest + compiler: gcc-latest + image: ghcr.io/seqan/gcc-latest + + - name: "TSan" + os: ubuntu-latest + compiler: clang-latest + image: ghcr.io/seqan/clang-latest + cxx_flags: "-fsanitize=thread" + + - name: "ASan" + os: ubuntu-latest + cxx_flags: "-fsanitize=address -Wno-maybe-uninitialized" + - name: "ASan" + os: macos-latest + cxx_flags: "-fsanitize=address" + + - name: "UBSan" + os: ubuntu-latest + cxx_flags: "-fsanitize=undefined,float-divide-by-zero -Wno-maybe-uninitialized -Wno-stringop-overflow" + - name: "UBSan" + os: macos-latest + cxx_flags: "-fsanitize=undefined,float-divide-by-zero,local-bounds,nullability" + + container: + # If an image is defined for a matrix entry, use it. + # Otherwise, use the "empty"/'' image which means do not use a container at all. + image: ${{ matrix.image || '' }} + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup compiler + if: contains(matrix.os, 'macos') + uses: seqan/actions/setup-compiler@main + with: + compiler: ${{ matrix.compiler }} + + - name: Configure tests + run: | + mkdir build && cd build + cmake ../test/analyse -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer ${{ matrix.cxx_flags }} -fno-sanitize-recover=all" + make gtest_main yaml-cpp + + - name: Build tests + working-directory: build + run: make -k + + - name: Run tests + working-directory: build + continue-on-error: true + id: test + run: ctest . -j --output-on-failure --no-tests=error ${{ matrix.ctest_excludes }} + + # Rerun failed tests with **one** thread. Some snippets touch the same file and fail in parallel. + - name: Rerun failed tests + if: steps.test.outcome == 'failure' + working-directory: build + run: ctest . -j1 --output-on-failure --no-tests=error --rerun-failed