Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kiancross committed Jun 12, 2021
0 parents commit 228a667
Show file tree
Hide file tree
Showing 13 changed files with 1,194 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
codecov:
allow_coverage_offsets: true

coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true

comment:
layout: "reach, diff, flags"
7 changes: 7 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
75 changes: 75 additions & 0 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Automated Tests

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

jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- uses: actions/checkout@v2

- name: Generate Build Tree ⚙️
run: cmake . -B build -DCODE_COVERAGE=on

- name: Build Library 🧰
run: cmake --build build --target rash

- name: Build Tests 🧰
run: cmake --build build --target tests

- name: Test 🔬
run: ctest --test-dir build

- name: Upload Coverage Report 📊
uses: codecov/codecov-action@v1
with:
env_vars: OS

- name: Save Testing Logs 📤
if: always()
uses: actions/upload-artifact@v2
with:
name: testing-logs
path: build/Testing


memory-leaks:
name: Check Memory Leaks
runs-on: ubuntu-latest
needs: build-and-test

steps:
- uses: actions/checkout@v2

- name: Install Valgrind 🔧
run: sudo apt-get install valgrind

- name: Generate Build Tree ⚙️
run: cmake . -B build

- name: Build 🧰
run: cmake --build build

- name: Check For Memory Leaks 🔬
run: ctest --test-dir build -T memcheck

- name: Save Logs 📤
if: always()
uses: actions/upload-artifact@v2
with:
name: memory-check-logs
path: build/Testing
36 changes: 36 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CodeQL

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "37 21 * * 1"

jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- uses: actions/checkout@v2

- name: Initialize CodeQL 🔧
uses: github/codeql-action/init@v1
with:
languages: c

- name: Generate Build Tree ⚙️
run: cmake .

- name: Build 🧰
run: cmake --build .

- name: Perform CodeQL Analysis 🤖
uses: github/codeql-action/analyze@v1
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

DartConfiguration.tcl

src/librash.a
tests/test_rash

/profiling
/report
/build
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (C) 2021 Kian Cross
#

cmake_minimum_required(VERSION 3.13)
project(rash VERSION 1.0 LANGUAGES C)

set(CMAKE_C_STANDARD 99)

add_library(coverage_config INTERFACE)
option(CODE_COVERAGE "Enable coverage reporting" OFF)

if(CODE_COVERAGE AND CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(coverage_config INTERFACE -O0 -g --coverage)
target_link_options(coverage_config INTERFACE --coverage)
endif()

add_subdirectory(src)

if (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include (CTest)
enable_testing()
add_subdirectory(tests)
endif()
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (C) 2021 Kian Cross

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rash

[![Automated Tests](https://github.com/kiancross/rash/actions/workflows/automated-tests.yml/badge.svg?event=push)](https://github.com/kiancross/rash/actions/workflows/automated-tests.yml)
[![CodeQL](https://github.com/kiancross/rash/actions/workflows/codeql.yml/badge.svg?event=push)](https://github.com/kiancross/rash/actions/workflows/codeql.yml)
[![codecov](https://codecov.io/gh/kiancross/rash/branch/master/graph/badge.svg?token=4I6gyzBbyV)](https://codecov.io/gh/kiancross/rash)

An implementation of the Robin Hood hashing algorithm in C.
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (C) 2021 Kian Cross
#

set(CMAKE_C_STANDARD 99)
add_library(rash STATIC rash.c)
target_link_libraries(rash PUBLIC coverage_config)
Loading

0 comments on commit 228a667

Please sign in to comment.