Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Feb 28, 2022
0 parents commit 27b150d
Show file tree
Hide file tree
Showing 99 changed files with 3,989 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBraces: Custom
ColumnLimit: 120
DerivePointerAlignment: false
IncludeCategories:
- Regex: '^(<|")(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdargh|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h'
Priority: 1
- Regex: '^(<|")(cstdlib|csignal|csetjmp|cstdarg|typeinfo|typeindex|type_traits|bitset|functional|utility|ctime|chrono|cstddef|initializer_list|tuple|any|optional|variant|new|memory|scoped_allocator|memory_resource|climits|cfloat|cstdint|cinttypes|limits|exception|stdexcept|cassert|system_error|cerrno|cctype|cwctype|cstring|cwchar|cuchar|string|string_view|array|vector|deque|list|forward_list|set|map|unordered_set|unordered_map|stack|queue|algorithm|execution|teratorslibrary|iterator|cmath|complex|valarray|random|numeric|ratio|cfenv|iosfwd|ios|istream|ostream|iostream|fstream|sstream|strstream|iomanip|streambuf|cstdio|locale|clocale|codecvt|regex|atomic|thread|mutex|shared_mutex|future|condition_variable|filesystem|ciso646|ccomplex|ctgmath|cstdalign|cstdbool)(>|")$'
Priority: 2
- Regex: '^<.*\.(h|hpp)>'
Priority: 3
- Regex: '^".*"'
Priority: 4
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
...
40 changes: 40 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FormatStyle: file

Checks: '
-*,
bugprone*,
cppcoreguidelines*
google*,
llvm*,
misc*,
modernize*,
readability*,
-modernize-use-trailing-return-type,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-llvmlibc-implementation-in-namespace,
-llvmlibc-callee-namespace,
-llvmlibc-restrict-system-libc-headers,
'

WarningsAsErrors: '*'

CheckOptions:
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.MethodCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Software Lab",
"image": "makeappdev/cpp-dev",
"extensions": [
"ms-vscode.cpptools-extension-pack",
"eamodio.gitlens",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"cheshirekow.cmake-format",
"yzhang.markdown-all-in-one",
"ms-azuretools.vscode-docker"
],
"settings": {
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
},
}
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

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

jobs:

cpp:
runs-on: ubuntu-latest
container: makeappdev/cpp-dev
strategy:
matrix:
include:
- compiler: gcc
- compiler: clang
steps:
- uses: actions/checkout@v2
- name: Build ${{ matrix.compiler }}
run: |
use_${{ matrix.compiler }}.sh
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j8
make test
make coverage
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Tests
run: make test
- name: Coverage
run: make coverage_reports

AsciiDoc:
runs-on: ubuntu-latest
container: asciidoctor/docker-asciidoctor:latest
steps:
- name: Install rsync
run: apk add rsync
- uses: actions/checkout@v2
- name: Build
run: |
cd docs
make html
make pdf
slides:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
mkdir -p build && chmod -R 0777 build
make slides
deploy:
runs-on: ubuntu-latest
needs:
- cpp
- python
- super-lint
- AsciiDoc
- slides
if: github.ref == 'refs/heads/master'
setps:
- name: Install dependencies
run: apt-get update && apt-get install -y zip
- name: Prepare Deploy
run: | # TODO use cache to share generated documents: https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows
mkdir -p public
mv docs/output/* public
mv slides/build/* public
mkdir -p public/export
make package
mv export/*.zip public/export
make solution_package
mv export/*.zip public/export
mkdir -p public/coverage
mv build/ccov/all-merged public/coverage/cpp
mv tools/htmlcov/ public/coverage/python
echo "# This branch is for deployment only" >> public/README.md
- name: Deploy Artifacts
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: public
single-commit: true
silent: true
57 changes: 57 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# ******** NOTE ********

name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 9 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
if: matrix.language != 'cpp'
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit 27b150d

Please sign in to comment.