generated from userver-framework/service_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) Docker workflow выключен из-за того, что в Dockerfile userver используется g++ 9.4, который сегфолтится 2) Добавлены автостоп ранов и очистка старых ранов 3) Пофикшен CMake проекта: инклуды прокидываются по таргетам 4) Добавлены шаблонные парсеры, сериализаторы для json/http
- Loading branch information
1 parent
e4837f9
commit b7226dd
Showing
58 changed files
with
1,342 additions
and
469 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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
BasedOnStyle: google | ||
# Описание настроек форматирования для clang-format 14 | ||
|
||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
UseTab: Never | ||
BreakBeforeBraces: Attach | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: false | ||
ColumnLimit: 80 | ||
PointerAlignment: Left | ||
SpaceAfterCStyleCast: true | ||
DerivePointerAlignment: false | ||
IncludeBlocks: Preserve | ||
AlignTrailingComments: true |
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 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
utests/hello_test.cpp | ||
utests/convert_test.cpp |
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 |
---|---|---|
|
@@ -15,22 +15,37 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
- os: ubuntu-22.04 | ||
make: test-debug | ||
info: g++-9 + test-debug | ||
info: g++-11 + test-debug | ||
|
||
- os: ubuntu-20.04 | ||
- os: ubuntu-22.04 | ||
make: test-release | ||
info: g++-9 + test-release | ||
info: g++-11 + test-release | ||
|
||
name: '${{matrix.os}}: ${{matrix.info}}' | ||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: add Postgres package repository | ||
run: | | ||
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null | ||
- name: Install packages | ||
run: | | ||
sudo apt update | ||
sudo apt install --allow-downgrades -y pep8 $(cat dependencies/${{matrix.os}}.md | tr '\n' ' ') | ||
sudo apt install clang-format-11 | ||
sudo pip install $(cat dependencies/python.md) | tr '\n' ' ' | ||
- name: install g++11 | ||
run: | | ||
sudo apt install g++-11 | ||
export CXX=/usr/bin/g++-11 | ||
- name: Check format sources | ||
run: | | ||
make check-format | ||
|
@@ -47,12 +62,6 @@ jobs: | |
${{matrix.os}} ${{matrix.info}} ccache-dir ${{github.ref}} run-' | ||
${{matrix.os}} ${{matrix.info}} ccache- | ||
- name: Install packages | ||
run: | | ||
sudo apt update | ||
sudo apt install --allow-downgrades -y pep8 $(cat third_party/userver/scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ') | ||
sudo pip install $(cat dependencies/python.md) | tr '\n' ' ' | ||
- name: Setup ccache | ||
run: | | ||
ccache -M 2.0GB | ||
|
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,57 @@ | ||
name: Delete old workflow runs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
days: | ||
description: 'Number of days.' | ||
required: true | ||
default: 0 | ||
minimum_runs: | ||
description: 'The minimum runs to keep for each workflow.' | ||
required: true | ||
default: 0 | ||
delete_workflow_pattern: | ||
description: 'The name or filename of the workflow. if not set then it will target all workflows.' | ||
required: false | ||
delete_workflow_by_state_pattern: | ||
description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' | ||
required: true | ||
default: "All" | ||
type: choice | ||
options: | ||
- "All" | ||
- active | ||
- deleted | ||
- disabled_inactivity | ||
- disabled_manually | ||
delete_run_by_conclusion_pattern: | ||
description: 'Remove workflow by conclusion: action_required, cancelled, failure, skipped, success' | ||
required: true | ||
default: failure | ||
type: choice | ||
options: | ||
- "All" | ||
- action_required | ||
- cancelled | ||
- failure | ||
- skipped | ||
- success | ||
dry_run: | ||
description: 'Only log actions, do not perform any delete operations.' | ||
required: false | ||
|
||
jobs: | ||
del_runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete workflow runs | ||
uses: Mattraks/delete-workflow-runs@v2 | ||
with: | ||
token: ${{ github.token }} | ||
repository: ${{ github.repository }} | ||
retain_days: ${{ github.event.inputs.days }} | ||
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} | ||
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} | ||
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} | ||
delete_run_by_conclusion_pattern: ${{ github.event.inputs.delete_run_by_conclusion_pattern }} | ||
dry_run: ${{ github.event.inputs.dry_run }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "third_party/userver"] | ||
path = third_party/userver | ||
url = https://github.com/userver-framework/userver.git | ||
url = https://github.com/userver-framework/userver.git |
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 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 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 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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
#include "../src/views/hello/view.hpp" | ||
#include <benchmark/benchmark.h> | ||
|
||
#include <cstdint> // for std::uint64_t | ||
#include <iterator> // for std::size | ||
#include <string_view> | ||
|
||
#include <benchmark/benchmark.h> | ||
#include <userver/engine/run_standalone.hpp> | ||
|
||
#include "views/hello/view.hpp" | ||
|
||
void HelloBenchmark(benchmark::State& state) { | ||
userver::engine::RunStandalone([&] { | ||
constexpr std::string_view kNames[] = {"userver", "is", "awesome", "!"}; | ||
std::uint64_t i = 0; | ||
userver::engine::RunStandalone([&] { | ||
constexpr std::string_view kNames[] = {"userver", "is", "awesome", "!"}; | ||
std::uint64_t i = 0; | ||
|
||
for (auto _ : state) { | ||
const auto name = kNames[i++ % std::size(kNames)]; | ||
auto result = service_template::SayHelloTo( | ||
name, service_template::UserType::kKnown); | ||
benchmark::DoNotOptimize(result); | ||
} | ||
}); | ||
for (auto _ : state) { | ||
const auto name = kNames[i++ % std::size(kNames)]; | ||
auto result = service_template::SayHelloTo( | ||
name, service_template::UserType::kKnown); | ||
benchmark::DoNotOptimize(result); | ||
} | ||
}); | ||
} | ||
|
||
BENCHMARK(HelloBenchmark); |
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,43 @@ | ||
cmake | ||
libboost1.74-dev | ||
libboost-program-options1.74-dev | ||
libboost-filesystem1.74-dev | ||
libboost-locale1.74-dev | ||
libboost-regex1.74-dev | ||
libboost-iostreams1.74-dev | ||
libev-dev | ||
zlib1g-dev | ||
libcurl4-openssl-dev | ||
libcrypto++-dev | ||
libyaml-cpp-dev | ||
libssl-dev | ||
libfmt-dev | ||
libcctz-dev | ||
libhttp-parser-dev | ||
libjemalloc-dev | ||
libmongoc-dev | ||
libbson-dev | ||
libldap2-dev | ||
libpq-dev | ||
postgresql-server-dev-15 | ||
libkrb5-dev | ||
libhiredis-dev | ||
libgrpc-dev | ||
libgrpc++-dev | ||
libgrpc++1 | ||
protobuf-compiler-grpc | ||
libprotoc-dev | ||
python3-dev | ||
python3-protobuf | ||
python3-jinja2 | ||
python3-virtualenv | ||
python3-voluptuous | ||
libc-ares-dev | ||
libspdlog-dev | ||
libbenchmark-dev | ||
libgmock-dev | ||
libgtest-dev | ||
ccache | ||
git | ||
postgresql-15 | ||
redis-server |
Oops, something went wrong.