Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Build and Test Actions #11

Merged
merged 8 commits into from
Feb 4, 2021
Merged
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/linux_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🏁 Linux Builds
on:
push:
branches: [ master, main, github_actions_brook ]

env:
BUILD_TYPE: release

jobs:
windows-compilation:
name: Linux Compilation
runs-on: "ubuntu-20.04"
steps:

# Checkout project
- uses: actions/checkout@v2

# Create a build directory to store all the CMake generated files
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Tests
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest . -C $BUILD_TYPE -V

- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix bin

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: win64
path: build/bin/
47 changes: 47 additions & 0 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🏁 MacOS Builds
on:
push:
branches: [ master, main, github_actions_brook ]

env:
BUILD_TYPE: release

jobs:
windows-compilation:
name: MacOS Compilation
runs-on: "macos-latest"
steps:

# Checkout project
- uses: actions/checkout@v2

# Create a build directory to store all the CMake generated files
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Tests
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest . -C $BUILD_TYPE -V

- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix bin

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: win64
path: build/bin/
47 changes: 47 additions & 0 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🏁 Windows Builds
on:
push:
branches: [ master, main, github_actions_brook ]

env:
BUILD_TYPE: release

jobs:
windows-compilation:
name: Windows Compilation
runs-on: "windows-latest"
steps:

# Checkout project
- uses: actions/checkout@v2

# Create a build directory to store all the CMake generated files
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Tests
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest . -C $BUILD_TYPE -V

- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix bin

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: win64
path: build/bin/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ inkcpp_cl/*.ink
Documentation/*

# Output
Build/*
Build/*
build/*
bin/
Bin/
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.16)

# Testing enabled
enable_testing()

# Project setup
project(inkcpp VERSION 0.1)

Expand Down
2 changes: 1 addition & 1 deletion inkcpp/string_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace ink::runtime::internal

// Add to the tree
bool success = _table.insert(data, true); // TODO: Should it start as used?
assert(success, "Duplicate string pointer in the string_table. How is that possible?");
inkAssert(success, "Duplicate string pointer in the string_table. How is that possible?");
if (!success)
{
delete[] data;
Expand Down
2 changes: 1 addition & 1 deletion inkcpp/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ink
*(buf++) = 0;
}

void assert(bool condition, const char* msg /*= nullptr*/)
void ink_assert(bool condition, const char* msg /*= nullptr*/)
{
if (!condition)
throw ink_exception(msg);
Expand Down
4 changes: 3 additions & 1 deletion inkcpp_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ add_executable(inkcpp_test catch.hpp Main.cpp
Restorable.cpp
)

target_link_libraries(inkcpp_test PUBLIC inkcpp)
target_link_libraries(inkcpp_test PUBLIC inkcpp)

add_test(NAME UnitTests COMMAND $<TARGET_FILE:inkcpp_test>)
14 changes: 6 additions & 8 deletions shared/public/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <stdexcept>
#endif

#undef assert

namespace ink
{
typedef unsigned int uint32_t;
Expand Down Expand Up @@ -97,10 +95,10 @@ namespace ink

// assert
#ifndef INK_ENABLE_UNREAL
void assert(bool condition, const char* msg = nullptr);
[[ noreturn ]] inline void assert(const char* msg = nullptr) { assert(false, msg); }
void ink_assert(bool condition, const char* msg = nullptr);
[[ noreturn ]] inline void ink_assert(const char* msg = nullptr) { ink_assert(false, msg); }
#else
[[ noreturn ]] inline void fail(const char*) { check(false); throw nullptr; }
[[ noreturn ]] inline void ink_fail(const char*) { check(false); throw nullptr; }
#endif

#ifdef INK_ENABLE_STL
Expand Down Expand Up @@ -130,9 +128,9 @@ namespace ink
#ifdef INK_ENABLE_UNREAL
#define inkZeroMemory(buff, len) FMemory::Memset(buff, 0, len)
#define inkAssert(condition, text) checkf(condition, TEXT(text))
#define inkFail(text) ink::fail(text)
#define inkFail(text) ink::ink_fail(text)
#else
#define inkZeroMemory ink::zero_memory
#define inkAssert ink::assert
#define inkFail(text) ink::assert(text)
#define inkAssert ink::ink_assert
#define inkFail(text) ink::ink_assert(text)
#endif