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
49 changes: 49 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: 2.1

executors:
docker-executor:
docker:
- image: cloudcomputing321/shadowdash:latest

jobs:
build:
executor: docker-executor
steps:
- checkout
- run:
name: Build Project
command: |
cmake -Bbuild-cmake
cmake --build build-cmake
- run:
name: Run clang-format
command: |
find . -iname '*.cpp' -o -iname '*.h' | xargs clang-format --dry-run
- persist_to_workspace:
root: .
paths:
- build-cmake

test:
parallelism: 4
executor: docker-executor
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run Tests In Parallelism with CTests
command: |
cd build-cmake
ctest --output-junit results.xml --verbose -j4
- store_test_results:
path: build-cmake

workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ cmake_minimum_required(VERSION 3.15)
include(CheckSymbolExists)
include(CheckIPOSupported)

# Enable testing
enable_testing()

# Config clang-tidy
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
if(CLANG_TIDY_EXE)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
else()
message(WARNING "clang-tidy not found!")
endif()

option(NINJA_BUILD_BINARY "Build ninja binary" ON)
option(NINJA_FORCE_PSELECT "Use pselect() even on platforms that provide ppoll()" OFF)

Expand Down Expand Up @@ -312,6 +323,11 @@ if(BUILD_TESTING)
endif()

add_test(NAME NinjaTest COMMAND ninja_test)
add_test(NAME build_log_perftest COMMAND build_log_perftest)
add_test(NAME canon_perftest COMMAND canon_perftest)
add_test(NAME clparser_perftest COMMAND clparser_perftest)
add_test(NAME elide_middle_perftest COMMAND elide_middle_perftest)
add_test(NAME hash_collision_bench COMMAND hash_collision_bench)
endif()

if(NINJA_BUILD_BINARY)
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Use a base image
FROM cimg/base:current

USER root

# Install clang-tidy and python3
RUN apt-get update && \
apt-get install -y clang-tidy clang-format python3 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN [ -x "$(command -v python)" ] || ln -s $(command -v python3) /usr/bin/python