Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

name: Build the project
run-name: Build the project on behalf of ${{ github.actor }}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- dev
jobs:
build:
runs-on: windows-latest

steps:

- name: Install Conan
run: pip3 install 'conan>=2.0.0'

- name: Conan version
run: conan --version

- name: Checkout
uses: actions/checkout@v4

- name: Cache conan database
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-database
with:
path: ~/.conan2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/conanfile.py') }}

- if: ${{ steps.cache-conan.outputs.cache-hit != 'true' }}
name: List the state of conan local cache
continue-on-error: true
run: conan list *

- name: Resolve dependencies
run: .\1.resolve.dependencies.cmd

- name: Generate solution
run: .\2.generate.solution.cmd

- name: Build solution
run: .\3.build.all.cmd
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

build/
CMakeUserPresets.json
2 changes: 2 additions & 0 deletions 0.clean.all.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

rmdir .\build /s /q
12 changes: 12 additions & 0 deletions 1.resolve.dependencies.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

conan install . --output-folder=build/conan --build=missing

conan profile detect --force

set CUR_DIR=%CD%

conan install . --output-folder=%CUR_DIR%\build\conan --build=missing -s build_type=RelWithDebInfo
if %errorlevel% neq 0 exit /b %errorlevel%

conan install . --output-folder=%CUR_DIR%\build\conan --build=missing -s build_type=Debug
if %errorlevel% neq 0 exit /b %errorlevel%
4 changes: 4 additions & 0 deletions 2.generate.solution.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

cmake -S .\ -B .\build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=.\build\conan\conan_toolchain.cmake -DCMAKE_CONFIGURATION_TYPES="Debug;RelWithDebInfo"

if %errorlevel% neq 0 exit /b %errorlevel%
6 changes: 6 additions & 0 deletions 3.build.all.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

cmake --build .\build --config "Debug"
if %errorlevel% neq 0 exit /b %errorlevel%

cmake --build .\build --config "RelWithDebInfo"
if %errorlevel% neq 0 exit /b %errorlevel%
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

cmake_minimum_required(VERSION 3.26)

project(windows.pep VERSION 1.0.0 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)

#if(EXISTS "${CMAKE_BINARY_DIR}/conan/conanbuildinfo.cmake")
#include(${CMAKE_BINARY_DIR}/conan/conanbuildinfo.cmake)
#endif()

#conan_basic_setup()

find_package("Boost" 1.84.0 COMPONENTS test thread log log_setup REQUIRED)

message( "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
message( "CONAN_INCLUDE_DIRS: " ${CONAN_INCLUDE_DIRS} )
message( "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
message( "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
message( "CONAN_LIBS: " ${CONAN_LIBS} )
#include_directories(${CONAN_INCLUDE_DIRS})
include_directories(${CMAKE_INCLUDE_PATH})
#CMAKE_LIBRARY_PATH

add_subdirectory(src/tests)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# github-actions
# github-actions
12 changes: 12 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from conan import ConanFile


class WindowsPEP(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"

def requirements(self):
self.requires("boost/1.84.0")

# def build_requirements(self):
# self.tool_requires("cmake/3.26.0")
18 changes: 18 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

set( MODULE_NAME ${CMAKE_PROJECT_NAME}.unit.tests)

project(${MODULE_NAME} VERSION 1.0.0 LANGUAGES CXX C)

file(GLOB_RECURSE UnitTests_Src
*.cpp
*.h
)

include_directories(${CONAN_INCLUDE_DIRS})

add_executable(${MODULE_NAME} WIN32 ${UnitTests_Src} )
set_target_properties(${MODULE_NAME} PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" )
target_precompile_headers(${MODULE_NAME} PRIVATE stdafx.h)
target_link_libraries( ${MODULE_NAME} Boost::unit_test_framework )
#target_link_libraries( ${MODULE_NAME} Boost )
#target_link_libraries(timer ${CONAN_LIBS})
31 changes: 31 additions & 0 deletions src/tests/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//#define BOOST_TEST_MODULE MyTest
//#include <boost/asio.hpp
//#include <boost/test/included/unit_test.hpp>
//#include <boost/test/unit_test.hpp>

//BOOST_AUTO_TEST_CASE( my_test )
//{
// BOOST_CHECK( false );
//}

#define BOOST_TEST_MODULE PoltavaUnitTests
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_CASE( TestCase_1 )
{
BOOST_TEST( true );
}

BOOST_AUTO_TEST_CASE( TestCase_2 )
{
BOOST_TEST( true );
}

/*
int main(int argc, const char* argv[])
{
std::cout << "This is placeholder project for unit tests.\n";

return 0;
}
*/
2 changes: 2 additions & 0 deletions src/tests/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

#include <iostream>