Skip to content

Commit 1f15cdc

Browse files
committed
[INFRA] Proper project
1 parent ed9452a commit 1f15cdc

15 files changed

Lines changed: 376 additions & 63 deletions

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
6+
7+
version: 2
8+
updates:
9+
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: REUSE Compliance Check
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: license-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: ${{ github.event_name != 'push' }}
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: REUSE Compliance Check
26+
uses: fsfe/reuse-action@v5

.github/workflows/ci_linux.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: Linux
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: linux-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: ${{ github.event_name != 'push' }}
17+
18+
env:
19+
TZ: Europe/Berlin
20+
21+
defaults:
22+
run:
23+
shell: bash -Eeuxo pipefail {0}
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 60
29+
name: ${{ matrix.compiler }} C++${{ matrix.cpp }} ${{ matrix.build_type }}
30+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest", "intel"]
35+
cpp: [20, 23, 26]
36+
build_type: [Release, Debug]
37+
exclude:
38+
- compiler: gcc-third-latest
39+
cpp: 26
40+
container:
41+
image: ghcr.io/seqan/${{ matrix.compiler }}
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Configure tests
47+
run: |
48+
mkdir build && cd build
49+
cmake ../ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
50+
-DCMAKE_CXX_STANDARD=${{ matrix.cpp }}
51+
52+
- name: Build tests
53+
working-directory: build
54+
run: make -k
55+
56+
- name: Run tests
57+
working-directory: build
58+
run: ctest . -j --output-on-failure --no-tests=error
59+

.github/workflows/ci_macos.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: macOS
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: macos-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: ${{ github.event_name != 'push' }}
17+
18+
env:
19+
TZ: Europe/Berlin
20+
21+
defaults:
22+
run:
23+
shell: bash -Eeuxo pipefail {0}
24+
25+
jobs:
26+
build:
27+
name: ${{ matrix.compiler }} C++${{ matrix.cpp }} ${{ matrix.build_type }}
28+
runs-on: macos-latest
29+
timeout-minutes: 60
30+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest"]
35+
cpp: [20, 23, 26]
36+
build_type: [Release, Debug]
37+
exclude:
38+
- compiler: gcc-third-latest
39+
cpp: 26
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Setup compiler
45+
uses: seqan/actions/setup-compiler@main
46+
with:
47+
compiler: ${{ matrix.compiler }}
48+
49+
- name: Configure tests
50+
run: |
51+
mkdir build && cd build
52+
cmake ../ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
53+
-DCMAKE_CXX_STANDARD=${{ matrix.cpp }}
54+
55+
- name: Build tests
56+
working-directory: build
57+
run: make -k
58+
59+
- name: Run tests
60+
working-directory: build
61+
run: ctest . -j --output-on-failure --no-tests=error

.github/workflows/ci_win.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
name: Windows
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
pull_request:
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: windows-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: ${{ github.event_name != 'push' }}
17+
18+
env:
19+
TZ: Europe/Berlin
20+
21+
jobs:
22+
build:
23+
name: ${{ matrix.generator }} C++${{ matrix.cpp }} ${{ matrix.build_type }}
24+
runs-on: windows-2022
25+
timeout-minutes: 60
26+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
generator: "Visual Studio 17 2022"
31+
cpp: [20, 23, 26]
32+
build_type: [Release, Debug]
33+
steps:
34+
- name: Setup MSVC
35+
uses: ilammy/msvc-dev-cmd@v1
36+
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
40+
- name: Configure tests
41+
run: |
42+
New-Item -Name "build" -ItemType "directory" -Force
43+
cd build
44+
cmake .. -G "${{ matrix.generator }}" `
45+
-DCMAKE_CXX_FLAGS="/EHsc /W4" `
46+
-DCMAKE_CXX_STANDARD=${{ matrix.cpp }}
47+
48+
- name: Build tests
49+
working-directory: build
50+
run: cmake --build . --config "${{ matrix.build_type }}" --parallel
51+
52+
- name: Run tests
53+
working-directory: build
54+
run: ctest . -j -C "${{ matrix.build_type }}" --output-on-failure --no-tests=error --timeout 240

CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2+
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
cmake_minimum_required (VERSION 3.25)
6+
7+
project (SEQAN_STD
8+
LANGUAGES CXX
9+
VERSION 1.0.0
10+
DESCRIPTION "Implementation of several C++23/26 views"
11+
)
12+
13+
get_filename_component (SEQAN_STD_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
14+
if (NOT SEQAN_STD_DIR_NAME STREQUAL "seqan-std")
15+
message (FATAL_ERROR "The directory name must be 'seqan-std'.")
16+
endif ()
17+
18+
file (REAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." SEQAN_STD_INCLUDE_DIR)
19+
20+
add_library (seqan-std INTERFACE)
21+
target_sources (seqan-std INTERFACE
22+
FILE_SET HEADERS
23+
TYPE HEADERS
24+
BASE_DIRS ${SEQAN_STD_INCLUDE_DIR}
25+
FILES
26+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/all_view.hpp
27+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/chunk_by_view.hpp
28+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/chunk_view.hpp
29+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/concepts.hpp
30+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_base.hpp
31+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_for_view_without_args.hpp
32+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_from_functor.hpp
33+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/exposition_only.hpp
34+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/movable_box.hpp
35+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/non_propagating_cache.hpp
36+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/enumerate_view.hpp
37+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/join_with_view.hpp
38+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/pair.hpp
39+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/to.hpp
40+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/tuple.hpp
41+
${SEQAN_STD_INCLUDE_DIR}/seqan-std/zip_view.hpp
42+
)
43+
target_compile_features (seqan-std INTERFACE cxx_std_20)
44+
add_library (seqan::std ALIAS seqan-std)
45+
46+
option (SEQAN_STD_TEST "Enable testing for seqan-std." ${PROJECT_IS_TOP_LEVEL})
47+
48+
if (SEQAN_STD_TEST)
49+
enable_testing ()
50+
add_subdirectory (test)
51+
endif ()

chunk_by_view.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ using std::ranges::views::chunk_by;
2929
# include "all_view.hpp"
3030
# include "concepts.hpp"
3131
# include "detail/adaptor_from_functor.hpp"
32-
# include "detail/compiler_definitions.hpp"
3332
# include "detail/movable_box.hpp"
3433
# include "detail/non_propagating_cache.hpp"
3534

chunk_view.hpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ using std::ranges::views::chunk;
3131
# include "all_view.hpp"
3232
# include "concepts.hpp"
3333
# include "detail/adaptor_from_functor.hpp"
34-
# include "detail/compiler_definitions.hpp"
3534
# include "detail/exposition_only.hpp"
3635
# include "detail/non_propagating_cache.hpp"
3736

@@ -59,13 +58,13 @@ constexpr auto to_unsigned_like(T v) noexcept
5958
// correctly.
6059
// MSVC: is using std::_Signed128
6160
// stdlibc++: is using __int128
62-
#if defined(_MSC_VER) && !defined(__clang__)
63-
using max_signed_t = std::_Signed128;
64-
using max_unsigned_t = std::_Unsigned128;
65-
#else
66-
__extension__ using max_signed_t = __int128;
67-
__extension__ using max_unsigned_t = unsigned __int128;
68-
#endif
61+
# if defined(_MSC_VER) && !defined(__clang__)
62+
using max_signed_t = std::_Signed128;
63+
using max_unsigned_t = std::_Unsigned128;
64+
# else
65+
__extension__ using max_signed_t = __int128;
66+
__extension__ using max_unsigned_t = unsigned __int128;
67+
# endif
6968

7069
constexpr auto to_unsigned_like(max_signed_t v) noexcept
7170
{
@@ -88,9 +87,7 @@ template <std::ranges::view V>
8887
requires std::ranges::input_range<V>
8988
class chunk_view<V> : public std::ranges::view_interface<chunk_view<V>>
9089
{
91-
// clang-format off
92-
SEQAN_STD_NESTED_VISIBILITY
93-
// clang-format on
90+
private:
9491
V base_;
9592
std::ranges::range_difference_t<V> n_;
9693
std::ranges::range_difference_t<V> remainder_ = 0;
@@ -429,8 +426,8 @@ class chunk_view_iterator
429426
std::ranges::range_difference_t<Base> missing_ = 0;
430427

431428
constexpr chunk_view_iterator(Parent * parent,
432-
std::ranges::iterator_t<Base> current,
433-
std::ranges::range_difference_t<Base> missing = 0) :
429+
std::ranges::iterator_t<Base> current,
430+
std::ranges::range_difference_t<Base> missing = 0) :
434431
current_{current},
435432
end_{std::ranges::end(parent->base_)},
436433
n_{parent->n_},

detail/compiler_definitions.hpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

enumerate_view.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ using std::ranges::views::enumerate;
2828
# include "all_view.hpp"
2929
# include "concepts.hpp"
3030
# include "detail/adaptor_from_functor.hpp"
31-
# include "detail/compiler_definitions.hpp"
3231
# include "detail/exposition_only.hpp"
3332

3433
namespace seqan::stl::ranges
@@ -38,9 +37,7 @@ template <std::ranges::view V>
3837
requires seqan::stl::detail::range_with_movable_references<V>
3938
class enumerate_view : public std::ranges::view_interface<enumerate_view<V>>
4039
{
41-
// clang-format off
42-
SEQAN_STD_NESTED_VISIBILITY
43-
// clang-format on
40+
private:
4441
V base_ = V();
4542

4643
template <bool Const>

0 commit comments

Comments
 (0)