diff --git a/.github/ISSUE_TEMPLATE/cron_comment_template.md b/.github/ISSUE_TEMPLATE/cron_comment_template.md index c57d3be8c5..3b77fd92f7 100644 --- a/.github/ISSUE_TEMPLATE/cron_comment_template.md +++ b/.github/ISSUE_TEMPLATE/cron_comment_template.md @@ -1,4 +1,4 @@ -Failure {{ build }} on gcc{{ compiler }} +Failure {{ build }} on {{ compiler }} --- See {{ url }} for more information. diff --git a/.github/workflows/cron_api.yml b/.github/workflows/cron_api.yml index 6c84a55bdb..56b5530bf7 100644 --- a/.github/workflows/cron_api.yml +++ b/.github/workflows/cron_api.yml @@ -18,76 +18,58 @@ concurrency: env: SEQAN3_NO_VERSION_CHECK: 1 TZ: Europe/Berlin - ISSUE: 2746 # Issue number to use for reporting failures + ISSUE: 3280 # Issue number to use for reporting failures defaults: run: - shell: bash -Eexuo pipefail {0} + shell: bash -Eeuxo pipefail {0} jobs: build: - name: API-Stability gcc${{ matrix.compiler }} - runs-on: ubuntu-22.04 - timeout-minutes: 300 + name: API-Stability ${{ matrix.compiler }} + runs-on: ubuntu-latest if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: - compiler: [11, 12, 13] - + compiler: ["gcc-14", "gcc-13", "gcc-12", "gcc-11"] + container: + image: ghcr.io/seqan/${{ matrix.compiler }} + volumes: + - /home/runner:/home/runner steps: - - name: Checkout SeqAn3 + - name: Checkout uses: actions/checkout@v4 with: - path: seqan3 - fetch-depth: 1 submodules: true - name: Checkout SeqAn2 uses: actions/checkout@v4 with: repository: seqan/seqan - path: seqan3/submodules/seqan - fetch-depth: 1 - - - name: Setup compiler - uses: seqan/actions/setup-compiler@main - with: - compiler: gcc-${{ matrix.compiler }} - - - name: Install CMake - uses: seqan/actions/setup-cmake@main - with: - cmake: 3.16.9 + path: submodules/seqan - name: Configure tests run: | - mkdir seqan3-build - cd seqan3-build - cmake ../seqan3/test/api_stability -DCMAKE_BUILD_TYPE=Release + mkdir build && cd build + cmake ../test/api_stability -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" - name: Build tests - run: | - cd seqan3-build - CMAKE_BUILD_PARALLEL_LEVEL=2 cmake --build . -- -k 2>&1 | tee build.log - - - name: Setup Python - if: ${{ failure() }} - uses: actions/setup-python@v5 - with: - python-version: '3.x' + working-directory: build + run: make -k 2>&1 | tee build.log - name: Process Log - if: ${{ failure() }} + if: failure() run: | - FILE="seqan3/.github/ISSUE_TEMPLATE/cron_comment_template.md" - python3 seqan3/.github/workflows/scripts/process_compiler_error_log.py seqan3-build/build.log >> $FILE + FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md" + python3 .github/workflows/scripts/process_compiler_error_log.py build/build.log >> ${FILE} - name: Create comment body - if: ${{ failure() }} + if: failure() id: comment-body run: | - FILE="seqan3/.github/ISSUE_TEMPLATE/cron_comment_template.md" + FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md" URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" sed -i "s@{{ build }}@${{ matrix.build }}@" $FILE sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" $FILE @@ -96,21 +78,31 @@ jobs: cat $FILE >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + - name: Create comment body + if: success() + id: comment-body + run: echo "body=Success ${{ matrix.build }} on ${{ matrix.compiler }}" >> $GITHUB_OUTPUT + - name: Reopen issue - if: ${{ failure() }} - uses: octokit/request-action@v2.x - with: - route: PATCH /repos/{owner}/{repo}/issues/{issue_number} - owner: ${{ github.repository_owner }} - repo: seqan3 - issue_number: ${{ env.ISSUE }} - state: "open" + if: failure() + run: gh issue reopen ${{ env.ISSUE }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.SEQAN_ACTIONS_PAT }} + GH_REPO: ${{ github.repository }} - - name: Create comment - if: ${{ failure() }} + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: find_comment + with: + issue-number: ${{ env.ISSUE }} + body-includes: ${{ matrix.build }} on ${{ matrix.compiler }} + + - name: Update comment uses: peter-evans/create-or-update-comment@v4 with: + comment-id: ${{ steps.find_comment.outputs.comment-id }} issue-number: ${{ env.ISSUE }} body: ${{ steps.comment-body.outputs.body }} + edit-mode: replace + token: ${{ secrets.SEQAN_ACTIONS_PAT }} + diff --git a/.github/workflows/scripts/process_compiler_error_log.py b/.github/workflows/scripts/process_compiler_error_log.py index 486881447d..d8f1f1372a 100644 --- a/.github/workflows/scripts/process_compiler_error_log.py +++ b/.github/workflows/scripts/process_compiler_error_log.py @@ -11,8 +11,8 @@ import re import sys -# https://regex101.com/r/aE0qX3/1 -tokenise_regex = re.compile(r"(\[\s*\d+%\](?:.(?!\[\s*\d+%\]))+(?:error:).*?(?=\[\s*\d+%\]|$))", re.DOTALL) +# https://regex101.com/r/aE0qX3/2 +tokenise_regex = re.compile(r"(\[\s*\d+%\](?:.(?!\[\s*\d+%\]))+(?:: error:).*?(?=\[\s*\d+%\]|$))", re.DOTALL) # Match line containg 'error:', but stop at linebreak, semicolon or parenthesis. error_regex = re.compile(r"(error:[^(;\n]*)") diff --git a/test/api_stability/3.3.0/0001-FIX-take_until_view_test.patch b/test/api_stability/3.3.0/0001-FIX-take_until_view_test.patch index ff467dd7b7..4fb63dddc9 100644 --- a/test/api_stability/3.3.0/0001-FIX-take_until_view_test.patch +++ b/test/api_stability/3.3.0/0001-FIX-take_until_view_test.patch @@ -1,7 +1,7 @@ -From e89261cd4f2dfdffe982e8c95af1666acf9cfc47 Mon Sep 17 00:00:00 2001 +From e3f24c7888ab68746b9beb7619a1dd6661a73d71 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Thu, 28 Sep 2023 21:28:37 +0200 -Subject: [PATCH 1/2] [FIX] take_until_view_test +Subject: [PATCH 1/4] [FIX] take_until_view_test mutable refers to the capture --- @@ -27,5 +27,5 @@ index 970a3a1b1..8f34f7014 100644 }); do_concepts(adapt2, false); -- -2.42.0 +2.43.0 diff --git a/test/api_stability/3.3.0/0002-FIX-Change-constexpr-test.patch b/test/api_stability/3.3.0/0002-FIX-Change-constexpr-test.patch index 2b0984812e..7acb15b848 100644 --- a/test/api_stability/3.3.0/0002-FIX-Change-constexpr-test.patch +++ b/test/api_stability/3.3.0/0002-FIX-Change-constexpr-test.patch @@ -1,7 +1,7 @@ -From e3eaa3f826fbab51db415d0dd6cbf8a93ecad153 Mon Sep 17 00:00:00 2001 +From cb9c300606e3a4c1860f3195b98f5245f09474e5 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Thu, 28 Sep 2023 19:35:57 +0200 -Subject: [PATCH 2/2] [FIX] Change constexpr test +Subject: [PATCH 2/4] [FIX] Change constexpr test gcc11 complains suddenly --- @@ -21,5 +21,5 @@ index 54bcb640c..460fab223 100644 + [[maybe_unused]] static constinit auto combined = adaptor1 | adaptor2; } -- -2.42.0 +2.43.0 diff --git a/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch b/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch new file mode 100644 index 0000000000..ba100574f2 --- /dev/null +++ b/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch @@ -0,0 +1,81 @@ +From 9f061adb903403ee7e039f6480c87d7d1c577c14 Mon Sep 17 00:00:00 2001 +From: Enrico Seiler +Date: Sun, 28 Jul 2024 15:17:28 +0200 +Subject: [PATCH 3/4] [API] hamming scoring scheme + +--- + .../08_pairwise_alignment/pa_assignment_3_solution.cpp | 6 ++++-- + .../alignment/configuration/align_cfg_method_global.cpp | 6 ++++-- + .../alignment/configuration/minimal_alignment_config.err | 2 +- + .../alignment/configuration/align_config_edit_test.cpp | 8 ++++++-- + 4 files changed, 15 insertions(+), 7 deletions(-) + +diff --git a/doc/tutorial/08_pairwise_alignment/pa_assignment_3_solution.cpp b/doc/tutorial/08_pairwise_alignment/pa_assignment_3_solution.cpp +index d9790afca..b761ca884 100644 +--- a/doc/tutorial/08_pairwise_alignment/pa_assignment_3_solution.cpp ++++ b/doc/tutorial/08_pairwise_alignment/pa_assignment_3_solution.cpp +@@ -28,8 +28,10 @@ int main() + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} +- | seqan3::align_cfg::scoring_scheme{ +- seqan3::aminoacid_scoring_scheme{seqan3::aminoacid_similarity_matrix::blosum62}}; ++ | seqan3::align_cfg::scoring_scheme{seqan3::aminoacid_scoring_scheme{ ++ seqan3::aminoacid_similarity_matrix::blosum62}} ++ | seqan3::align_cfg::gap_cost_affine{seqan3::align_cfg::open_score{-10}, ++ seqan3::align_cfg::extension_score{-1}}; + + for (auto const & res : seqan3::align_pairwise(source, config)) + seqan3::debug_stream << "Score: " << res.score() << '\n'; +diff --git a/test/snippet/alignment/configuration/align_cfg_method_global.cpp b/test/snippet/alignment/configuration/align_cfg_method_global.cpp +index 0e1f92757..46e74c3dd 100644 +--- a/test/snippet/alignment/configuration/align_cfg_method_global.cpp ++++ b/test/snippet/alignment/configuration/align_cfg_method_global.cpp +@@ -11,8 +11,10 @@ int main() + { + // configure a global alignment for DNA sequences + auto min_cfg = seqan3::align_cfg::method_global{} +- | seqan3::align_cfg::scoring_scheme{ +- seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}}; ++ | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, ++ seqan3::mismatch_score{-5}}} ++ | seqan3::align_cfg::gap_cost_affine{seqan3::align_cfg::open_score{-10}, ++ seqan3::align_cfg::extension_score{-1}}; + + auto seq1 = "TCGT"_dna4; + auto seq2 = "ACGA"_dna4; +diff --git a/test/snippet/alignment/configuration/minimal_alignment_config.err b/test/snippet/alignment/configuration/minimal_alignment_config.err +index 7f8f011eb..f599e28b8 100644 +--- a/test/snippet/alignment/configuration/minimal_alignment_config.err ++++ b/test/snippet/alignment/configuration/minimal_alignment_config.err +@@ -1 +1 @@ +-7 ++10 +diff --git a/test/unit/alignment/configuration/align_config_edit_test.cpp b/test/unit/alignment/configuration/align_config_edit_test.cpp +index 7ec211537..ee2e501a8 100644 +--- a/test/unit/alignment/configuration/align_config_edit_test.cpp ++++ b/test/unit/alignment/configuration/align_config_edit_test.cpp +@@ -9,14 +9,18 @@ + + #include + #include ++#include ++#include + + TEST(align_cfg_edit, is_hamming) + { + auto scheme = seqan3::get(seqan3::align_cfg::edit_scheme).scheme; + +- for (unsigned i = 0; i < decltype(scheme)::matrix_size; ++i) ++ constexpr uint32_t dna15_size_v = seqan3::alphabet_size; ++ ++ for (uint32_t i = 0; i < dna15_size_v; ++i) + { +- for (unsigned j = 0; j < decltype(scheme)::matrix_size; ++j) ++ for (uint32_t j = 0; j < dna15_size_v; ++j) + { + if (i == j) + EXPECT_EQ((scheme.score(seqan3::assign_rank_to(i, seqan3::dna15{}), +-- +2.43.0 + diff --git a/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch.license b/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch.license new file mode 100644 index 0000000000..706402f5fe --- /dev/null +++ b/test/api_stability/3.3.0/0003-API-hamming-scoring-scheme.patch.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin +SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +SPDX-License-Identifier: BSD-3-Clause diff --git a/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch b/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch new file mode 100644 index 0000000000..642a137981 --- /dev/null +++ b/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch @@ -0,0 +1,43 @@ +From 72f044049983ad3f2e72ea4342f9573102088479 Mon Sep 17 00:00:00 2001 +From: Enrico Seiler +Date: Sun, 28 Jul 2024 16:06:27 +0200 +Subject: [PATCH 4/4] [FIX] Unsupported SAM header + +--- + test/unit/io/sam_file/format_sam_test.cpp | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/test/unit/io/sam_file/format_sam_test.cpp b/test/unit/io/sam_file/format_sam_test.cpp +index 66683ce3b..3cdba0078 100644 +--- a/test/unit/io/sam_file/format_sam_test.cpp ++++ b/test/unit/io/sam_file/format_sam_test.cpp +@@ -174,16 +174,16 @@ TEST_F(sam_format, header_errors) + "@SQ\tSN:ref2\tLN:243199373\tSB:user_tag\tLB:user_tag\tpb:user_tag\n" + "@RG\tID:U0a_A2_L1\tIB:user_tag\tpb:user_tag\n" + "@PG\tID:qc\tIB:user_tag\tPB:user_tag\tCB:user_tag\tDB:user_tag\tVB:user_tag\tpb:user_tag\n"}; +- std::string expected_cerr{"Unsupported SAM header tag in @HD: VB\n" +- "Unsupported SAM header tag in @HD: SB\n" +- "Unsupported SAM header tag in @HD: GB\n" +- "Unsupported SAM header tag in @HD: pb\n" +- "Unsupported SAM header tag in @PG: IB\n" +- "Unsupported SAM header tag in @PG: PB\n" +- "Unsupported SAM header tag in @PG: CB\n" +- "Unsupported SAM header tag in @PG: DB\n" +- "Unsupported SAM header tag in @PG: VB\n" +- "Unsupported SAM header tag in @PG: pb\n"}; ++ std::string expected_cerr{"Unsupported tag found in SAM header @HD: \"VB:user_tag\"\n" ++ "Unsupported tag found in SAM header @HD: \"SB:user_tag\"\n" ++ "Unsupported tag found in SAM header @HD: \"GB:user_tag\"\n" ++ "Unsupported tag found in SAM header @HD: \"pb:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"IB:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"PB:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"CB:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"DB:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"VB:user_tag\"\n" ++ "Unsupported tag found in SAM header @PG: \"pb:user_tag\"\n"}; + std::istringstream istream(header_str); + seqan3::sam_file_input fin{istream, seqan3::format_sam{}}; + +-- +2.43.0 + diff --git a/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch.license b/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch.license new file mode 100644 index 0000000000..706402f5fe --- /dev/null +++ b/test/api_stability/3.3.0/0004-FIX-Unsupported-SAM-header.patch.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin +SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +SPDX-License-Identifier: BSD-3-Clause diff --git a/test/api_stability/CMakeLists.txt b/test/api_stability/CMakeLists.txt index 199fb338ed..c91d2d05ed 100644 --- a/test/api_stability/CMakeLists.txt +++ b/test/api_stability/CMakeLists.txt @@ -37,13 +37,14 @@ macro (seqan3_api_stability_test test_suite git_apply) COMMAND ${CMAKE_COMMAND} -E remove_directory "/build_system" COMMAND sh -c "${git_apply}" TEST_BEFORE_INSTALL TRUE - TEST_COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j2 + TEST_COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j INSTALL_COMMAND "") endmacro () if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${SEQAN3_LAST_STABLE_VERSION}") set (SEQAN3_GIT_APPLY - "${GIT_EXECUTABLE} apply --verbose ${CMAKE_CURRENT_LIST_DIR}/${SEQAN3_LAST_STABLE_VERSION}/*.patch") + "${GIT_EXECUTABLE} init . && ${GIT_EXECUTABLE} apply --verbose ${CMAKE_CURRENT_LIST_DIR}/${SEQAN3_LAST_STABLE_VERSION}/*.patch" + ) else () set (SEQAN3_GIT_APPLY "true") message (STATUS "No patches found in ${CMAKE_CURRENT_LIST_DIR}/${SEQAN3_LAST_STABLE_VERSION}.") diff --git a/test/api_stability/README.md b/test/api_stability/README.md index b77a52105e..2d80649dbe 100644 --- a/test/api_stability/README.md +++ b/test/api_stability/README.md @@ -28,13 +28,13 @@ CMAKE_BUILD_PARALLEL_LEVEL=40 cmake --build . ### How does this work? -In the following, we will use `3.2.0` as the latest stable release (LSR). +In the following, we will use `3.3.0` as the latest stable release (LSR). The workflow entails these steps: 1. Download and unzip the LSR. 2. Remove everything from the LSR except the tests in `/test/`. 3. Apply patches from the current git version on the LSR, i.e., patches found in - `/test/api_stability/3.2.0`. + `/test/api_stability/3.3.0`. * These patches will only apply changes on the tests. * This step is necessary as some of our tests also test non-public / non-stable API. 3. Use the current version of `find_package (SeqAn3)` found in `/build_system`. @@ -83,9 +83,9 @@ There are two categories of API changes that are reflected in the patches (prefi ### How to create patches? -In the following, we will use `3.2.0` as the latest stable release (LSR). +In the following, we will use `3.3.0` as the latest stable release (LSR). -Create a new branch based on the LSR and apply all existing patches in `/test/api_stability/3.2.0`. +Create a new branch based on the LSR and apply all existing patches in `/test/api_stability/3.3.0`. ``` cd @@ -95,12 +95,12 @@ git checkout test/api # copy over patches to a tmp directory (`git am` seems to not support applying patches onto a different branch) mkdir -p /tmp/seqan3-api-stability-patches -cp test/api_stability/3.2.0/*.patch /tmp/seqan3-api-stability-patches +cp test/api_stability/3.3.0/*.patch /tmp/seqan3-api-stability-patches # create a new branch based on the LSR and switch to it -git checkout -b api-stability-patches 3.2.0 +git checkout -b api-stability-patches 3.3.0 -# apply all patches onto 3.2.0 (--keep-non-patch will keep `[NOAPI]` tags in the commit message) +# apply all patches onto 3.3.0 (--keep-non-patch will keep `[NOAPI]` tags in the commit message) git am --keep-non-patch /tmp/seqan3-api-stability-patches/*.patch # clean up applied patches @@ -135,8 +135,8 @@ New files for tests must not be added. After that, we can export all patches. ``` -# export all patches since 3.2.0 -git format-patch 3.2.0 +# export all patches since 3.3.0 +git format-patch 3.3.0 # move them to tmp directory mv *.patch /tmp/seqan3-api-stability-patches @@ -147,12 +147,12 @@ Now change to your branch that you were working on and check-in the patches. ``` git checkout test/api -cp /tmp/seqan3-api-stability-patches/*.patch test/api_stability/3.2.0/ +cp /tmp/seqan3-api-stability-patches/*.patch test/api_stability/3.3.0/ rm -fdr /tmp/seqan3-api-stability-patches # add new patches -git add test/api_stability/3.2.0/ +git add test/api_stability/3.3.0/ # commit changes git commit