Skip to content

Commit fa788d5

Browse files
committed
Checkpoint
1 parent 56db500 commit fa788d5

4 files changed

Lines changed: 28 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches: [ main, develop ]
66
pull_request:
77
branches: [ main ]
8+
release:
9+
types: [published]
810

911
jobs:
1012
test:
@@ -66,7 +68,7 @@ jobs:
6668

6769
docs:
6870
runs-on: ubuntu-latest
69-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
71+
if: github.event_name == 'release' && github.event.action == 'published'
7072
permissions:
7173
id-token: write
7274
pages: write

CMakePresets.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,26 @@
3131
"displayName": "Documentation Configuration",
3232
"description": "Configuration for building documentation",
3333
"binaryDir": "${sourceDir}/build/docs",
34-
"inherits": "test",
34+
"generator": "Ninja",
3535
"cacheVariables": {
36-
"BUILD_DOCS": "ON"
36+
"CMAKE_BUILD_TYPE": "Release",
37+
"BUILD_TESTING": "OFF",
38+
"BUILD_DOCS": "ON",
39+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
40+
"CMAKE_CXX_EXTENSIONS": "OFF"
3741
}
3842
},
3943
{
4044
"name": "clang-tidy",
4145
"displayName": "Clang-Tidy Configuration",
4246
"description": "Configuration for running clang-tidy static analysis",
4347
"binaryDir": "${sourceDir}/build/clang-tidy",
44-
"inherits": "test",
48+
"generator": "Ninja",
4549
"cacheVariables": {
50+
"CMAKE_BUILD_TYPE": "Debug",
51+
"BUILD_TESTING": "ON",
52+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
53+
"CMAKE_CXX_EXTENSIONS": "OFF",
4654
"CMAKE_CXX_CLANG_TIDY": "clang-tidy"
4755
}
4856
},
@@ -51,8 +59,12 @@
5159
"displayName": "Initialize Templates",
5260
"description": "Force regeneration of template files (CMakePresets.json, CI, etc.)",
5361
"binaryDir": "${sourceDir}/build/init",
54-
"inherits": "test",
62+
"generator": "Ninja",
5563
"cacheVariables": {
64+
"CMAKE_BUILD_TYPE": "Release",
65+
"BUILD_TESTING": "OFF",
66+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
67+
"CMAKE_CXX_EXTENSIONS": "OFF",
5668
"CPP_LIBRARY_FORCE_INIT": "ON"
5769
}
5870
}

examples/enum_ops_example.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#define DOCTEST_CONFIG_IMPLEMENT
2+
#include <doctest/doctest.h> // DOCTEST_CONFIG_IMPLEMENT
3+
4+
/// [EXAMPLE]
15
#include <stlab/enum_ops.hpp>
26

37
#include <iostream>
@@ -21,3 +25,6 @@ int main() {
2125
bool has_preview = (x & views::preview) == views::preview;
2226
std::cout << has_text << " " << has_preview << "\n";
2327
}
28+
/// [EXAMPLE]
29+
30+
TEST_CASE("Example: common use cases") { CHECK_NOTHROW(main()); }

include/stlab/enum_ops.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
\section Example Example
5353
5454
The following is an example of code that will compile:
55-
\include enum_ops_example.cpp
55+
56+
\snippet enum_ops_example.cpp EXAMPLE
5657
5758
The following is contains an example of code that will not compile
5859
since the typesafe operators have not been defined.

0 commit comments

Comments
 (0)