-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5569cf7
Showing
11 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: ${{ github.ref == 'refs/heads/master' }} | ||
tags: iantorres/authentication:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/cmake-build-debug | ||
/bin | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.25) | ||
PROJECT(Authentication VERSION 1.0.0 LANGUAGES CXX) | ||
|
||
SET(CMAKE_CXX_STANDARD 23) | ||
SET(CMAKE_CXX_STANDARD_REQUIRED True) | ||
|
||
OPTION(BUILD_TESTS "Build tests" OFF) | ||
|
||
INCLUDE(FetchContent) | ||
|
||
INCLUDE_DIRECTORIES(lib/headers) | ||
|
||
FILE(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/lib/sources/*.cpp") | ||
FILE(GLOB_RECURSE TESTS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cc") | ||
|
||
ADD_LIBRARY(authentication STATIC ${SOURCES}) | ||
|
||
TARGET_INCLUDE_DIRECTORIES(authentication PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/headers> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
|
||
INSTALL(DIRECTORY lib/headers/ DESTINATION include) | ||
|
||
INSTALL(TARGETS authentication | ||
EXPORT AuthenticationTargets | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
INCLUDES DESTINATION include | ||
) | ||
|
||
INSTALL(EXPORT AuthenticationTargets | ||
FILE AuthenticationTargets.cmake | ||
NAMESPACE authentication:: | ||
DESTINATION lib/cmake/Authentication | ||
) | ||
|
||
INCLUDE(CMakePackageConfigHelpers) | ||
CONFIGURE_PACKAGE_CONFIG_FILE( | ||
cmake/AuthenticationConfig.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/AuthenticationConfig.cmake | ||
INSTALL_DESTINATION lib/cmake/Authentication | ||
) | ||
|
||
INSTALL(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/AuthenticationConfig.cmake | ||
DESTINATION lib/cmake/Authentication | ||
) | ||
|
||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) | ||
|
||
if (BUILD_TESTS) | ||
FETCHCONTENT_DECLARE( | ||
googletest | ||
URL https://github.com/google/googletest/archive/b514bdc898e2951020cbdca1304b75f5950d1f59.zip | ||
) | ||
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FETCHCONTENT_MAKEAVAILABLE(googletest) | ||
ENABLE_TESTING() | ||
ADD_EXECUTABLE(tests ${TESTS} ${SOURCES}) | ||
TARGET_LINK_LIBRARIES(tests GTest::gtest_main) | ||
INCLUDE(GoogleTest) | ||
GTEST_DISCOVER_TESTS(tests) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM iantorres/boosted:amd64-latest | ||
|
||
COPY . . | ||
|
||
RUN mkdir build \ | ||
&& cd build \ | ||
&& cmake .. -DBUILD_TESTS=ON \ | ||
&& make \ | ||
&& cd ../bin \ | ||
&& ./tests | ||
|
||
RUN mkdir install \ | ||
&& cd install \ | ||
&& cmake .. -DBUILD_TESTS=OFF \ | ||
&& make \ | ||
&& make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ZenAlgorithms Authentication | ||
Copyright (C) 2024 Ian Torres <[email protected]> | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Build | ||
|
||
```shell | ||
git clone https://github.com/ZenAlgorithms/Authentication.git | ||
cd Authentication | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
make install | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
INCLUDE(CMakeFindDependencyMacro) | ||
|
||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/AuthenticationTargets.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <memory> | ||
#include <regex> | ||
|
||
namespace authentication { | ||
struct container { | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include <authentication/container.hpp> | ||
|
||
namespace authentication { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <gtest/gtest.h> | ||
|
||
TEST(Base, Assertions) { | ||
EXPECT_EQ(true, true); | ||
EXPECT_NE(true, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <gtest/gtest.h> | ||
#include <authentication/container.hpp> | ||
|
||
TEST(Authentication, Assertions) { | ||
using namespace authentication; | ||
} |