Compare commits

..

1 commit

Author SHA1 Message Date
0a30261c2c
build: change cmake build type to MOLD in conan 2025-07-17 11:46:21 +03:30
4 changed files with 40 additions and 114 deletions

View file

@ -1,3 +1,38 @@
kind: pipeline
type: docker
name: clang format
clone:
recursive: true
submodule_update_remote: true
trigger:
branch:
- main
steps:
- name: clang format
image: clang_format:latest
pull: if-not-exists
commands:
- |
set -e
clang-format --version
has_fomatting_issues=0
for file in $(find ./modules -name '*.?pp'); do
echo "Checking format for $file"
if ! clang-format --dry-run --Werror "$file"; then
echo "❌ Formatting issue detected in $file"
has_fomatting_issues=1
fi
done
if [ "$has_fomatting_issues" -eq 0 ]; then
echo "✅ All files are properly formatted! Well done! ^~^"
fi
exit ${has_fomatting_issues}
---
kind: pipeline
type: docker
@ -31,36 +66,6 @@ steps:
"$test"
done
---
kind: pipeline
type: docker
name: valgrind
clone:
recursive: true
submodule_update_remote: true
trigger:
branch:
- main
steps:
- name: valgrind
image: valgrind:latest
pull: if-not-exists
commands:
- |
set -e
git submodule update --init --recursive
conan build . \
-c tools.system.package_manager:mode=install \
-s build_type=Release \
-o enable_static_analysis=False \
-o enable_tests=True \
--build=missing
find ./build -type f -name "*_tests" -executable | xargs -I {} bash -c 'valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --error-exitcode=255 {}' || exit 1
---
kind: pipeline
type: docker
@ -88,39 +93,3 @@ steps:
-o enable_static_analysis=True \
-o enable_tests=True \
--build=missing
---
kind: pipeline
type: docker
name: clang format
clone:
recursive: true
submodule_update_remote: true
trigger:
branch:
- main
steps:
- name: clang format
image: clang_format:latest
pull: if-not-exists
commands:
- |
set -e
clang-format --version
has_fomatting_issues=0
for file in $(find ./modules -name '*.?pp'); do
echo "Checking format for $file"
if ! clang-format --dry-run --Werror "$file"; then
echo "❌ Formatting issue detected in $file"
has_fomatting_issues=1
fi
done
if [ "$has_fomatting_issues" -eq 0 ]; then
echo "✅ All files are properly formatted! Well done! ^~^"
fi
exit ${has_fomatting_issues}

View file

@ -6,12 +6,6 @@ namespace lt {
using lt::test::expect_le;
// error margin is high since run-time may slow down extremely due to
// sanitization/debugging or execution through valgrind...
//
// <1us error margin is tested manually in release builds and it works fine.
constexpr auto max_error_margin = std::chrono::milliseconds { 1 };
lt::test::Suite raii = [] {
using std::chrono::microseconds;
@ -40,14 +34,14 @@ lt::test::Suite reset_and_elapsed_time = [] {
};
lt::test::Case { "elapsed time is sane" } = [] {
expect_le(Timer {}.elapsed_time(), max_error_margin);
expect_le(Timer {}.elapsed_time(), microseconds { 1 });
};
lt::test::Case { "elapsed time is sane - constructed with old now" } = [] {
const auto timepoint = Timer::Clock::now() - hours { 1 };
// This fails sometimes in debug if error-range is under 10us
expect_le(Timer { timepoint }.elapsed_time(), hours { 1 } + max_error_margin);
expect_le(Timer { timepoint }.elapsed_time(), hours { 1 } + microseconds { 30 });
};
lt::test::Case { "reset -> elapsed time is sane - constructed with old now" } = [] {
@ -55,7 +49,7 @@ lt::test::Suite reset_and_elapsed_time = [] {
const auto old_elapsed_time = timer.elapsed_time();
timer.reset();
expect_le(timer.elapsed_time() - old_elapsed_time, microseconds { 100 } + max_error_margin);
expect_le(timer.elapsed_time() - old_elapsed_time, microseconds { 101 });
};
lt::test::Case { "reset -> elapsed time is sane - reset with future now" } = [] {
@ -63,7 +57,7 @@ lt::test::Suite reset_and_elapsed_time = [] {
const auto old_elapsed_time = timer.elapsed_time();
timer.reset(Timer::Clock::now() + microseconds { 100 });
expect_le(timer.elapsed_time() - old_elapsed_time, microseconds { 100 } + max_error_margin);
expect_le(timer.elapsed_time() - old_elapsed_time, microseconds { 101 });
};
};

View file

@ -22,9 +22,9 @@ RUN clang --version \
&& conan --version \
&& pip --version \
&& cmake --version \
&& g++ --version \
&& clang --version
RUN git clone 'https://git.light7734.com/light7734/light.git' --recursive \
&& cd light \
&& conan install . \

View file

@ -1,37 +0,0 @@
FROM alpine:latest
RUN apk add --no-cache \
bash \
clang \
llvm \
cmake \
git \
make \
g++ \
python3 \
py3-pip \
mesa-dev \
mesa-gl \
pkgconf \
valgrind
RUN pip install --no-cache-dir --break-system-packages conan gitpython \
&& conan profile detect
RUN clang --version \
&& conan --version \
&& pip --version \
&& cmake --version \
&& g++ --version \
&& clang --version
RUN git clone 'https://git.light7734.com/light7734/light.git' --recursive \
&& cd light \
&& conan install . \
-s build_type=Debug \
-c tools.system.package_manager:mode=install \
--build=missing \
&& conan install . \
-s build_type=Release \
-c tools.system.package_manager:mode=install \
--build=missing