diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 0000000..6ca043a --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,27 @@ +name: Documentation + +on: + push: + tags: + - '*' + +jobs: + build: + name: Build and publish documentation + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + + - name: Install doxygen + run: brew install doxygen + + - name: Build + run: | + cmake -Hdocumentation -Bbuild + cmake --build build --target GenerateDocs + + - name: Publish + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/doxygen/html diff --git a/README.md b/README.md index a92c59e..79150f7 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,12 @@ See [here](https://github.com/TheLartians/StaticTypeInfo) for an example header- Simply remove the standalone / documentation directory and according github workflow file. +> Can I build the standalone and tests at the same time? + +To keep the template modular, projects have been separated into their own CMake modules. +However it's easy to create a new directory, say `all`, that uses CPM.cmake to add both the standalone and the tests (as well as any other subprojects). +It's not recommended to include the standalone or tests from the main CMakeLists, as it will make the project mode difficult to be used as a library. + > I see you are using `GLOB` to add source files in CMakeLists.txt. Isn't that evil? Glob is considered bad because any changes to the source file structure [might not be automatically caught](https://cmake.org/cmake/help/latest/command/file.html#filesystem) by CMake's builders and you will need to manually invoke CMake on changes. diff --git a/include/greeter.h b/include/greeter.h index 36850ab..e3ff923 100644 --- a/include/greeter.h +++ b/include/greeter.h @@ -8,7 +8,7 @@ namespace greeter { enum class LanguageCode { EN, DE, ES, FR }; /** - * A class for greeting in multiple languages + * A class for saying hello in multiple languages */ class Greeter { std::string name; diff --git a/test/source/greeter.cpp b/test/source/greeter.cpp index ca8834d..eb12ab3 100644 --- a/test/source/greeter.cpp +++ b/test/source/greeter.cpp @@ -4,10 +4,10 @@ TEST_CASE("Greeter") { using namespace greeter; - Greeter greeter("World"); + Greeter greeter("Tests"); - CHECK(greeter.greet(LanguageCode::EN) == "Hello, World!"); - CHECK(greeter.greet(LanguageCode::DE) == "Hallo World!"); - CHECK(greeter.greet(LanguageCode::ES) == "¡Hola World!"); - CHECK(greeter.greet(LanguageCode::FR) == "Bonjour World!"); + CHECK(greeter.greet(LanguageCode::EN) == "Hello, Tests!"); + CHECK(greeter.greet(LanguageCode::DE) == "Hallo Tests!"); + CHECK(greeter.greet(LanguageCode::ES) == "¡Hola Tests!"); + CHECK(greeter.greet(LanguageCode::FR) == "Bonjour Tests!"); }