-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,566 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ignore third_party code from clang-format checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
Checks: | | ||
-*, | ||
clang-analyzer-*, | ||
clang-diagnostic-*, | ||
bugprone-*, | ||
readability-identifier-naming, | ||
readability-braces-around-statements, | ||
readability-inconsistent-declaration-parameter-name, | ||
readability-magic-numbers, | ||
readability-make-member-function-const, | ||
readability-named-parameter, | ||
readability-non-const-parameter, | ||
readability-qualified-auto, | ||
readability-redundant-preprocessor, | ||
readability-simplify-boolean-expr, | ||
readability-simplify-subscript-expr, | ||
readability-static-definition-in-anonymous-namespace, | ||
readability-uniqueptr-delete-release, | ||
readability-string-compare, | ||
llvm-namespace-comment, | ||
misc-definitions-in-headers, | ||
misc-misplaced-const, | ||
misc-redundant-expression, | ||
misc-throw-by-value-catch-by-reference, | ||
modernize-deprecated-headers, | ||
modernize-loop-convert, | ||
modernize-make-shared, | ||
modernize-make-unique, | ||
modernize-redundant-void-arg, | ||
modernize-replace-random-shuffle, | ||
modernize-use-auto, | ||
modernize-use-bool-literals, | ||
modernize-use-emplace, | ||
modernize-use-noexcept, | ||
modernize-use-nullptr, | ||
performance-faster-string-find, | ||
performance-for-range-copy, | ||
performance-implicit-conversion-in-loop, | ||
performance-inefficient-algorithm, | ||
performance-move-const-arg | ||
WarningsAsErrors: | | ||
clang-analyzer-*, | ||
clang-diagnostic-*, | ||
bugprone-*, | ||
readability-*, | ||
performance-* | ||
AnalyzeTemporaryDtors: false | ||
CheckOptions: | ||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case } | ||
- { key: readability-identifier-naming.UnionCase, value: lower_case } | ||
- { key: readability-identifier-naming.EnumCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassCase, value: lower_case } | ||
- { key: readability-identifier-naming.StructCase, value: lower_case } | ||
- { key: readability-identifier-naming.MethodCase, value: lower_case } | ||
- { key: readability-identifier-naming.MemberCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassConstantCase, value: CamelCase } | ||
- { key: readability-identifier-naming.ClassConstantPrefix , value: k } | ||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.EnumCase, value: lower_case } | ||
- { key: readability-identifier-naming.FunctionCase, value: lower_case } | ||
- { key: readability-identifier-naming.ParameterCase, value: lower_case } | ||
- { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase } | ||
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.EnumConstantCase, value: lower_case } | ||
- { key: readability-identifier-naming.ScopedEnumConstantCase, value: lower_case } | ||
|
||
- { key: readability-magic-numbers.IgnorePowersOf2IntegerValues, value: true } | ||
- { key: readability-implicit-bool-conversion.AllowPointerConditions, value: true } | ||
- { key: readability-inconsistent-declaration-parameter-name.Strict, value: true } | ||
|
||
- { key: llvm-namespace-comment.ShortNamespaceLines, value: 5 } | ||
- { key: modernize-use-auto.MinTypeNameLength, value: 15 } | ||
- { key: misc-definitions-in-headers.HeaderFileExtensions, value: "h,hh,hpp,hxx,ipp" } | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Pull request checks | ||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
build-n-test: | ||
name: ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: "Ubuntu Latest" | ||
os: ubuntu-latest | ||
- name: "macOS Latest" | ||
os: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Install dependencies | ||
- name: Install dependencies on ubuntu | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq clang-format clang-tidy libboost-dev libboost-system-dev | ||
- name: Install dependencies on macos | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install boost | ||
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format" | ||
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy" | ||
# Run tests | ||
- name: Test | ||
run: .github/workflows/run.sh test | ||
# Lint code | ||
- name: Lint | ||
run: .github/workflows/run.sh lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish develop | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Install dependencies | ||
- name: Install dependencies on ubuntu | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq lcov libboost-dev libboost-system-dev | ||
# Make and report coverage | ||
- name: Collect coverage | ||
run: .github/workflows/run.sh coverage | ||
- name: Report coverage | ||
uses: coverallsapp/github-action@master | ||
with: | ||
path-to-lcov: coverage.info | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Publish master | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
github_pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Install dependencies | ||
- name: Install dependencies on ubuntu | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq doxygen | ||
pip3 install sphinx==3.5.4 breathe==4.29.0 exhale==0.2.3 furo==2021.4.11b34 | ||
# Make and deploy pages | ||
- name: Make pages | ||
run: .github/workflows/run.sh docs | ||
- name: Deploy pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build/docs/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
[[ "$TRACE" ]] && set -o xtrace | ||
set -o pipefail | ||
set -o errexit | ||
|
||
NUM_PROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu) | ||
|
||
build() { | ||
if [[ $# -lt 2 ]]; then | ||
echo "Build folder or target are absent" | ||
return 1 | ||
fi | ||
|
||
declare -r folder="$1" | ||
declare -r target="$2" | ||
shift 2 | ||
|
||
cmake -H. -B"$folder" "$@" | ||
cmake --build "$folder" --target "$target" "--" "-j$NUM_PROC" | ||
} | ||
|
||
build_testing() { | ||
if [[ $# -lt 1 ]]; then | ||
echo "Build folder is absent" | ||
return 1 | ||
fi | ||
|
||
declare -r folder="$1" | ||
|
||
build "$folder" "testing" "-DSTREAMCLIENT_BUILD_TESTING=ON" \ | ||
"-DSTREAMCLIENT_BUILD_DOCS=OFF" \ | ||
"-DSTREAMCLIENT_BUILD_EXAMPLES=OFF" \ | ||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"\ | ||
"-DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON" | ||
} | ||
|
||
collect_coverage() { | ||
if [[ $# -lt 1 ]]; then | ||
echo "Build folder is absent" | ||
return 1 | ||
fi | ||
|
||
lcov --no-external --directory $(pwd) --capture --output-file coverage.info | ||
lcov --remove coverage.info -o coverage.info "*/tests/*" "*/$1/*" | ||
} | ||
|
||
if [[ "$1" == "test" ]] ; then | ||
build_testing "build" | ||
|
||
elif [[ "$1" == "coverage" ]] ; then | ||
build_testing "build" | ||
collect_coverage "build" | ||
|
||
elif [[ "$1" == "collect-coverage" ]] ; then | ||
collect_coverage "build" | ||
|
||
elif [[ "$1" == "docs" ]] ; then | ||
build "build" "docs" "-DSTREAMCLIENT_BUILD_TESTING=OFF" \ | ||
"-DSTREAMCLIENT_BUILD_DOCS=ON" | ||
|
||
elif [[ "$1" == "lint" ]] ; then | ||
shift 1 | ||
./lint.py --color=always --style=file --build-path=./build --recursive "$@" include/ | ||
|
||
elif [[ "$1" == "build" ]] ; then | ||
shift 1 | ||
build "build" "all" "$@" | ||
|
||
else | ||
echo "Usage: $0 [test|coverage|collect-coverage|docs|lint|build]" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.