Skip to content

Commit

Permalink
Initial commit for gh-pages branch
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Jan 4, 2024
0 parents commit fc2db14
Show file tree
Hide file tree
Showing 225 changed files with 28,048 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Googlebenchmark
on: [push, pull_request]
#on:
# push:
# branches:
# - main

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install boost
id: install-boost
run: |
bash .github/workflows/scripts/install_boost.sh
echo "BOOST_ROOT=${{runner.workspace}}/Loki/boost_1_84_0" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: cmake -DENABLE_BENCHMARKING:BOOL=TRUE -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
working-directory: ${{runner.workspace}}/build
run: export CXXFLAGS="-Werror" && cmake --build .

# Run benchmark and store the output to a file
- name: Run benchmark
run: ${{runner.workspace}}/build/benchmarks/persistent_factory --benchmark_format=json | tee benchmark_result.json
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache/benchmarks/
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'googlecpp'
# Where the output from the benchmark tool is stored
output-file-path: benchmark_result.json
# Where the previous data file is stored
external-data-json-path: ./benchmarks/cache/benchmark-data.json
# Workflow will fail when an alert happens
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
# Upload the updated cache file for the next job by actions/cache
13 changes: 13 additions & 0 deletions .github/workflows/scripts/install_boost.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

wget --no-check-certificate 'https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz'
tar xf boost_1_84_0.tar.gz

## We use header-only parts

#cd boost_1_84_0
#./bootstrap.sh

# Compile with fPIC flag
#export CXXFLAGS="-fPIC"
#./b2 cxxflags="$CXXFLAGS" link=static
34 changes: 34 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Googletest Unit Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Download boost
id: install-boost
run: |
bash .github/workflows/scripts/install_boost.sh
echo "BOOST_ROOT=${{runner.workspace}}/Loki/boost_1_84_0" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: cmake -DENABLE_TESTING:BOOL=TRUE -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
working-directory: ${{runner.workspace}}/build
run: export CXXFLAGS="-Werror" && cmake --build .

- name: Test
working-directory: ${{runner.workspace}}/build/tests
run: GTEST_OUTPUT=xml:test-results/ GTEST_COLOR=1 ctest -V
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Build artefacts
build

# IDE files
.vscode

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
89 changes: 89 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
cmake_minimum_required(VERSION 3.13)

##############################################################
# Language setup
##############################################################

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

##############################################################
# Establish project
##############################################################

project(sketches VERSION 0.1 LANGUAGES C CXX)

# Compilation flags, some configuration-specific
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -pedantic -fPIC")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fomit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "-O3 -DDEBUG")

# Set a default build type if none was specified
set(default_build_type "Debug")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}', as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
endif()

option(ENABLE_TESTING "Enables compilation of tests." OFF)
if (ENABLE_TESTING)
message("Building tests enabled.")
else()
message("Building tests disabled.")
endif()

##############################################################
# CMake modules and macro files
##############################################################

# make cache variables for install destinations
include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/cmake"
)
include("configure_boost")
include("configure_ccache")

# CCache
configure_ccache()

# Boost
configure_boost()
find_package(Boost ${BOOST_MIN_VERSION})
include_directories(${Boost_INCLUDE_DIRS})
#include_directories("${PROJECT_SOURCE_DIR}/external/flatbuffers/include")


##############################################################
# Add library and executable targets
##############################################################

# Add FlatBuffers directly to our build. This defines the `flatbuffers` target.
#set(FLATBUFFERS_MAX_PARSING_DEPTH 16)
#set(FLATBUFFERS_SRC_DIR "${PROJECT_SOURCE_DIR}/external/flatbuffers/")
#add_subdirectory(${FLATBUFFERS_SRC_DIR}
# ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
# EXCLUDE_FROM_ALL)

add_subdirectory(src)

add_subdirectory(exe)

add_subdirectory(examples)

set(ENABLE_TESTING True)
if (ENABLE_TESTING)
add_subdirectory(tests)
endif()

set(ENABLE_BENCHMARKING True)
if (ENABLE_BENCHMARKING)
add_subdirectory(benchmarks)
endif()

###########
# Install #
###########
Loading

0 comments on commit fc2db14

Please sign in to comment.