Skip to content

Commit

Permalink
Merge pull request #4 from nieznanysprawiciel/CI-tests
Browse files Browse the repository at this point in the history
First attempt to msbuild CI
  • Loading branch information
nieznanysprawiciel authored Oct 13, 2024
2 parents 9e55351 + c90ddf7 commit a2c5cad
Show file tree
Hide file tree
Showing 144 changed files with 33,421 additions and 16,179 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./swGUI/GUI.sln

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
BUILD_CONFIGURATION: [Release, Debug]

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
with:
msbuild-architecture: x64

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /verbosity:minimal /p:Configuration=${{matrix.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
swGUI/ProjectDir/Output/TMP/
swCommonLib/.vs/

_Target/*
*/_Target

*/.vs/
*/.idea/

.idea
.vs
2 changes: 1 addition & 1 deletion swCommonLib/Common/Buffers/BufferRaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "swCommonLib/Common/TypesDefinitions.h"
#include "swCommonLib/Common/RTTR.h"

#include <allocators>
#include <memory>



Expand Down
2 changes: 1 addition & 1 deletion swCommonLib/Common/Buffers/BufferTyped.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "BufferRaw.h"

#include <allocators>
#include <memory>
#include <assert.h>


Expand Down
6 changes: 6 additions & 0 deletions swCommonLib/Common/Converters/Convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ inline sw::Nullable< typename std::enable_if< std::is_enum< DstType >::value, Ds
// Wstring to string
//====================================================================================//

// std::codecvt_utf8 deprecated since C++17 without replacement.
#pragma warning( push )
#pragma warning( disable: 4996 )

// ================================ //
//
template<>
Expand All @@ -157,6 +161,8 @@ inline sw::Nullable< typename std::enable_if< std::is_same< SrcType, std::wstrin
return converter.from_bytes( value );
}

#pragma warning( pop )

//====================================================================================//
// Arithemetic types
//====================================================================================//
Expand Down
8 changes: 4 additions & 4 deletions swCommonLib/Common/Exceptions/Nullable.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class Nullable
std::string GetErrorReason () const;
ErrorType GetError () const;

bool operator== ( const ContentType& that );
bool operator!= ( const ContentType& that );
bool operator== ( const ContentType& that ) const;
bool operator!= ( const ContentType& that ) const;
Nullable< ContentType >& operator= ( const Nullable< ContentType >& that );

const ContentType & Get () const&;
Expand Down Expand Up @@ -307,15 +307,15 @@ inline typename Nullable< ContentType >::ErrorType Nullable< ContentType >::Get
// ================================ //
//
template< typename ContentType >
inline bool Nullable< ContentType >::operator== ( const ContentType & that )
inline bool Nullable< ContentType >::operator== ( const ContentType & that ) const
{
return m_isValid && Content == that;
}

// ================================ //
//
template< typename ContentType >
inline bool Nullable< ContentType >::operator!= ( const ContentType & that )
inline bool Nullable< ContentType >::operator!= ( const ContentType & that ) const
{
return !( *this == that );
}
Expand Down
4 changes: 2 additions & 2 deletions swCommonLib/Common/Macros/DefineFmtFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct ::fmt::formatter< ClassType > \
auto parse( ParseContext& ctx ) { return ctx.begin(); } \
\
template< typename FormatContext > \
auto format( const ClassType& d, FormatContext& ctx ) { \
auto format( const ClassType& d, FormatContext& ctx ) const { \
return format_to( ctx.out(), FormatString, FOR_EACH( _APPEND_INST ,__VA_ARGS__ ) ); \
} \
};
Expand All @@ -52,7 +52,7 @@ struct ::fmt::formatter< ClassType > \
auto parse( ParseContext& ctx ) { return ctx.begin(); } \
\
template< typename FormatContext > \
auto format( const ClassType& d, FormatContext& ctx ) { \
auto format( const ClassType& d, FormatContext& ctx ) const { \
return format_to( ctx.out(), "{}", Function( d ) ); \
} \
};
Expand Down
11 changes: 6 additions & 5 deletions swCommonLib/Common/Macros/GenerateOperators.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ namespace sw
#define _APPEND_INSTANCE_OBJ2( member ) _APPEND_INSTANCE( obj2, member )

#define _GENERATE_OPERATOR( OP, ClassType, ... ) \
inline bool operator##OP( const ClassType& obj1, const ClassType& obj2 )\
{ \
return std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ1, __VA_ARGS__ ) ) \
OP std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ2, __VA_ARGS__ ) ); \
}
inline static bool operator##OP( const ClassType& obj1, const ClassType& obj2 ) \
{ \
return std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ1, __VA_ARGS__ ) ) \
OP std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ2, __VA_ARGS__ ) ); \
} \


/**@brief Generates operator== function for ClassType.
Pass all class members as variadic parameters.*/
Expand Down
2 changes: 1 addition & 1 deletion swCommonLib/Common/Nullable.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct Nullable
}


bool operator!()
bool operator!() const
{
return !IsValid;
}
Expand Down
4 changes: 2 additions & 2 deletions swCommonLib/Common/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ std::string Version::ToString () const

// ================================ //
//
bool Version::operator< ( const Version& other )
bool Version::operator< ( const Version& other ) const
{
if( Major < other.Major )
return true;
Expand All @@ -100,7 +100,7 @@ bool Version::operator< ( const Version& other )

// ================================ //
//
bool Version::operator== ( const Version& other )
bool Version::operator== ( const Version& other ) const
{
return Major == other.Major
&& Minor == other.Minor
Expand Down
4 changes: 2 additions & 2 deletions swCommonLib/Common/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ struct Version
static Nullable< Version > From ( const std::string& versionStr );

/**@brief Version comparision.*/
bool operator< ( const Version& other );
bool operator< ( const Version& other ) const;

/**@brief Version comparision.*/
bool operator== ( const Version& other );
bool operator== ( const Version& other ) const;

/**@brief Conversts to string.
String has the same fromat as Version::From function expects as input.*/
Expand Down
1 change: 1 addition & 0 deletions swCommonLib/Common/fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// This is kind of joke!!
// Disable including windows.h.
#define FMT_USE_WINDOWS_H 0
#define FMT_UNICODE 0

#include "swCommonLib/External/fmt/format.h"

Loading

0 comments on commit a2c5cad

Please sign in to comment.