mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 20:18:53 +03:00
Add clazy to CI
This commit is contained in:
parent
5743a6de04
commit
f3e1941612
4 changed files with 43 additions and 15 deletions
|
@ -4,6 +4,36 @@ variables:
|
||||||
# prevent configure tzdata hanging apt install commands
|
# prevent configure tzdata hanging apt install commands
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
|
build-clazy:
|
||||||
|
stage: build
|
||||||
|
image: ubuntu:21.10
|
||||||
|
tags: [docker]
|
||||||
|
variables:
|
||||||
|
CLAZY_CHECKS: level0,level1,no-non-pod-global-static
|
||||||
|
TRAVIS_OS_NAME: linux
|
||||||
|
before_script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y software-properties-common
|
||||||
|
- apt-get update && apt-get -y install --no-install-recommends build-essential ninja-build cmake gcc make automake liblmdb-dev
|
||||||
|
libssl-dev libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediaquick5 libqt5svg5-dev
|
||||||
|
qtmultimedia5-dev qtquickcontrols2-5-dev qttools5-dev qttools5-dev-tools qtdeclarative5-dev
|
||||||
|
qml-module-qtmultimedia qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qt-labs-platform
|
||||||
|
qt5keychain-dev ccache clazy libcurl4-openssl-dev libevent-dev libspdlog-dev git libolm-dev nlohmann-json3-dev libcmark-dev asciidoc
|
||||||
|
script:
|
||||||
|
- export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}"
|
||||||
|
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
|
||||||
|
- cmake -GNinja -H. -Bbuild
|
||||||
|
-DCMAKE_INSTALL_PREFIX=.deps/usr
|
||||||
|
-DHUNTER_ENABLED=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_MTXCLIENT=ON -DUSE_BUNDLED_COEURL=ON -DUSE_BUNDLED_LMDBXX=ON
|
||||||
|
-DVOIP=OFF
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
-DCI_BUILD=ON -DFETCHCONTENT_QUIET=OFF -DCMAKE_CXX_COMPILER=clazy -DCMAKE_CXX_FLAGS="-Werror"
|
||||||
|
- cmake --build build
|
||||||
|
cache:
|
||||||
|
key: "$CI_JOB_NAME"
|
||||||
|
paths:
|
||||||
|
- .ccache
|
||||||
|
|
||||||
build-gcc9:
|
build-gcc9:
|
||||||
stage: build
|
stage: build
|
||||||
image: ubuntu:20.04
|
image: ubuntu:20.04
|
||||||
|
|
|
@ -414,7 +414,7 @@ if(USE_BUNDLED_MTXCLIENT)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
MatrixClient
|
MatrixClient
|
||||||
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
||||||
GIT_TAG v0.6.1
|
GIT_TAG 6a7eaa5006b1a18e132be7655e490d9819158dca
|
||||||
)
|
)
|
||||||
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
|
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
|
||||||
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
||||||
|
|
|
@ -191,8 +191,8 @@ modules:
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
name: mtxclient
|
name: mtxclient
|
||||||
sources:
|
sources:
|
||||||
- commit: 9be1d3615ad30395557ef2768215bc14fd6359bd
|
- commit: 6a7eaa5006b1a18e132be7655e490d9819158dca
|
||||||
tag: v0.6.1
|
#tag: v0.6.1
|
||||||
type: git
|
type: git
|
||||||
url: https://github.com/Nheko-Reborn/mtxclient.git
|
url: https://github.com/Nheko-Reborn/mtxclient.git
|
||||||
- config-opts:
|
- config-opts:
|
||||||
|
|
|
@ -350,7 +350,6 @@ secretName(std::string name, bool internal)
|
||||||
void
|
void
|
||||||
Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad)
|
Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto settings = UserSettings::instance()->qsettings();
|
auto settings = UserSettings::instance()->qsettings();
|
||||||
|
|
||||||
if (toLoad.empty()) {
|
if (toLoad.empty()) {
|
||||||
|
@ -362,7 +361,7 @@ Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad)
|
||||||
|
|
||||||
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
||||||
for (auto &[name_, internal] : toLoad) {
|
for (auto &[name_, internal] : toLoad) {
|
||||||
auto name = secretName(name_, internal);
|
auto name = secretName(name_, internal);
|
||||||
auto value = settings->value("secrets/" + name).toString();
|
auto value = settings->value("secrets/" + name).toString();
|
||||||
if (value.isEmpty()) {
|
if (value.isEmpty()) {
|
||||||
nhlog::db()->info("Restored empty secret '{}'.", name.toStdString());
|
nhlog::db()->info("Restored empty secret '{}'.", name.toStdString());
|
||||||
|
@ -376,7 +375,6 @@ Cache::loadSecrets(std::vector<std::pair<std::string, bool>> toLoad)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto [name_, internal] = toLoad.front();
|
auto [name_, internal] = toLoad.front();
|
||||||
|
|
||||||
auto job = new QKeychain::ReadPasswordJob(QCoreApplication::applicationName());
|
auto job = new QKeychain::ReadPasswordJob(QCoreApplication::applicationName());
|
||||||
|
@ -438,11 +436,11 @@ Cache::storeSecret(const std::string name_, const std::string secret, bool inter
|
||||||
|
|
||||||
auto settings = UserSettings::instance()->qsettings();
|
auto settings = UserSettings::instance()->qsettings();
|
||||||
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
||||||
settings->setValue("secrets/" + name, QString::fromStdString(secret));
|
settings->setValue("secrets/" + name, QString::fromStdString(secret));
|
||||||
// if we emit the signal directly it won't be received
|
// if we emit the signal directly it won't be received
|
||||||
QTimer::singleShot(0, this, [this, name_] { emit secretChanged(name_); });
|
QTimer::singleShot(0, this, [this, name_] { emit secretChanged(name_); });
|
||||||
nhlog::db()->info("Storing secret '{}' successful", name_);
|
nhlog::db()->info("Storing secret '{}' successful", name_);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto job = new QKeychain::WritePasswordJob(QCoreApplication::applicationName());
|
auto job = new QKeychain::WritePasswordJob(QCoreApplication::applicationName());
|
||||||
|
@ -485,10 +483,10 @@ Cache::deleteSecret(const std::string name, bool internal)
|
||||||
|
|
||||||
auto settings = UserSettings::instance()->qsettings();
|
auto settings = UserSettings::instance()->qsettings();
|
||||||
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
if (settings->value("run_without_secure_secrets_service", false).toBool()) {
|
||||||
settings->remove("secrets/" + name_);
|
settings->remove("secrets/" + name_);
|
||||||
// if we emit the signal directly it won't be received
|
// if we emit the signal directly it won't be received
|
||||||
QTimer::singleShot(0, this, [this, name] { emit secretChanged(name); });
|
QTimer::singleShot(0, this, [this, name] { emit secretChanged(name); });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto job = new QKeychain::DeletePasswordJob(QCoreApplication::applicationName());
|
auto job = new QKeychain::DeletePasswordJob(QCoreApplication::applicationName());
|
||||||
|
|
Loading…
Reference in a new issue