Skip to content

Commit

Permalink
Merge branch 'release/v1.1.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
i-vovk committed Aug 17, 2021
2 parents cbc64c8 + 3e43c22 commit 457c673
Show file tree
Hide file tree
Showing 45 changed files with 1,566 additions and 666 deletions.
1 change: 1 addition & 0 deletions .clang-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ignore third_party code from clang-format checks
83 changes: 83 additions & 0 deletions .clang-tidy
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" }
...
38 changes: 38 additions & 0 deletions .github/workflows/pull_request.yml
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
24 changes: 24 additions & 0 deletions .github/workflows/push_develop.yml
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 }}
25 changes: 25 additions & 0 deletions .github/workflows/push_master.yml
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
72 changes: 72 additions & 0 deletions .github/workflows/run.sh
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
# macOS folder view
**/.DS_Store

# HTML
*.html

# toolchain env
.idea/
.gradle/
build/
coverage-build/
coverage.*
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,73 @@
## 1.1.10 (2021-08-17)

### Bug Fixes

* connector::base_connection_pool: fix UB in dealing with boolean flag

### Misc

* Add github actions
* Update README
* Lint the code


## 1.1.9 (2021-07-30)

### Features

* connector::base_connection_pool: add try_get_session method
* connector::base_connection_pool: change global lock in watch_pool_routine with several small locks


## 1.1.8 (2021-07-14)

### Features

* ssl::stream_socket: set SNI hostname in ctor


## 1.1.7 (2021-06-30)

### Bug Fixes

* Fix mem leakage in static_allocator used for HTTP requests


## 1.1.6 (2021-06-29)

### Bug Fixes

* Fix static const undefined reference on some compilers for kHeaderLimit/kBodyLimit


## 1.1.5 (2021-02-12)

### Features

* Add idle timeout parameter for a pool. If session is sitting idle in the pool for a longer time it will replaced with new one


## 1.1.4 (2020-04-28)

### Bug Fixes

* TCP options not set in base_socket ctor


## 1.1.3 (2020-03-03)

### Bug Fixes

* get_session(timeout_or_deadline) return invalid socket


## 1.1.2 (2020-03-02)

### Features

* Add throwing get_session(timeout_or_deadline) function to the pool


## 1.1.1 (2020-03-02)

### Features
Expand All @@ -59,6 +80,7 @@
* Small README fixes
* Style-related fixes


# 1.1.0 (2020-01-27)

### Features
Expand All @@ -75,6 +97,7 @@

* Remove redundant ssl-handshake type parameter. Use client one


# 1.0.0 (2019-12-11)

- initial release
Loading

0 comments on commit 457c673

Please sign in to comment.