Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
55eb785682 | |||
f9c5057146 | |||
4a7a220af8 | |||
a43243ca3f | |||
5d30a56e22 | |||
51e044065a |
9 changed files with 110 additions and 101 deletions
180
.drone.yml
180
.drone.yml
|
@ -1,94 +1,94 @@
|
||||||
# ---
|
---
|
||||||
# kind: pipeline
|
kind: pipeline
|
||||||
# type: exec
|
type: exec
|
||||||
# name: amd64 — msvc
|
name: amd64 — msvc
|
||||||
# trigger:
|
trigger:
|
||||||
# branch:
|
branch:
|
||||||
# - main
|
- main
|
||||||
# platform:
|
platform:
|
||||||
# os: windows
|
os: windows
|
||||||
# arch: amd64
|
arch: amd64
|
||||||
#
|
|
||||||
# steps:
|
|
||||||
# - name: unit tests
|
|
||||||
# shell: powershell
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/msvc/unit_tests.ps1
|
|
||||||
#
|
|
||||||
# ---
|
|
||||||
# kind: pipeline
|
|
||||||
# type: docker
|
|
||||||
# name: amd64 — gcc
|
|
||||||
# trigger:
|
|
||||||
# branch:
|
|
||||||
# - main
|
|
||||||
#
|
|
||||||
# steps:
|
|
||||||
# - name: unit tests
|
|
||||||
# image: amd64_gcc_unit_tests:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/gcc/unit_tests.sh
|
|
||||||
#
|
|
||||||
# - name: valgrind
|
|
||||||
# image: amd64_gcc_valgrind:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/gcc/valgrind.sh
|
|
||||||
#
|
|
||||||
# ---
|
|
||||||
# kind: pipeline
|
|
||||||
# type: docker
|
|
||||||
# name: amd64 — clang
|
|
||||||
# trigger:
|
|
||||||
# branch:
|
|
||||||
# - main
|
|
||||||
#
|
|
||||||
# steps:
|
|
||||||
# - name: code coverage
|
|
||||||
# image: amd64_clang_coverage:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# environment:
|
|
||||||
# CODECOV_TOKEN:
|
|
||||||
# from_secret: CODECOV_TOKEN
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/clang/coverage.sh
|
|
||||||
#
|
|
||||||
# - name: leak sanitizer
|
|
||||||
# image: amd64_clang_lsan:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/clang/lsan.sh
|
|
||||||
#
|
|
||||||
# - name: memory sanitizer
|
|
||||||
# image: amd64_clang_msan:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/amd64/clang/msan.sh
|
|
||||||
#
|
|
||||||
# ---
|
|
||||||
# kind: pipeline
|
|
||||||
# type: docker
|
|
||||||
# name: static analysis
|
|
||||||
# trigger:
|
|
||||||
# branch:
|
|
||||||
# - main
|
|
||||||
#
|
|
||||||
# steps:
|
|
||||||
# - name: clang tidy
|
|
||||||
# image: clang_tidy:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# privileged: true
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/static_analysis/clang_tidy.sh
|
|
||||||
#
|
|
||||||
# - name: clang format
|
|
||||||
# image: clang_format:latest
|
|
||||||
# pull: if-not-exists
|
|
||||||
# commands:
|
|
||||||
# - ./tools/ci/static_analysis/clang_format.sh
|
|
||||||
|
|
||||||
# ---
|
steps:
|
||||||
|
- name: unit tests
|
||||||
|
shell: powershell
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/msvc/unit_tests.ps1
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: amd64 — gcc
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: unit tests
|
||||||
|
image: amd64_gcc_unit_tests:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/gcc/unit_tests.sh
|
||||||
|
|
||||||
|
- name: valgrind
|
||||||
|
image: amd64_gcc_valgrind:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/gcc/valgrind.sh
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: amd64 — clang
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: code coverage
|
||||||
|
image: amd64_clang_coverage:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
environment:
|
||||||
|
CODECOV_TOKEN:
|
||||||
|
from_secret: CODECOV_TOKEN
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/clang/coverage.sh
|
||||||
|
|
||||||
|
- name: leak sanitizer
|
||||||
|
image: amd64_clang_lsan:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/clang/lsan.sh
|
||||||
|
|
||||||
|
- name: memory sanitizer
|
||||||
|
image: amd64_clang_msan:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/amd64/clang/msan.sh
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: static analysis
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: clang tidy
|
||||||
|
image: clang_tidy:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
privileged: true
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/static_analysis/clang_tidy.sh
|
||||||
|
|
||||||
|
- name: clang format
|
||||||
|
image: clang_format:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- ./tools/ci/static_analysis/clang_format.sh
|
||||||
|
|
||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: documentation — development
|
name: documentation — development
|
||||||
|
|
|
@ -8,7 +8,8 @@ include(${CMAKE_DIR}/functions.cmake)
|
||||||
include(${CMAKE_DIR}/definitions.cmake)
|
include(${CMAKE_DIR}/definitions.cmake)
|
||||||
include(${CMAKE_DIR}/dependencies.cmake)
|
include(${CMAKE_DIR}/dependencies.cmake)
|
||||||
|
|
||||||
add_option(ENABLE_TESTS "Enables the building of the test modules")
|
add_option(ENABLE_UNIT_TESTS "Enables the building of the unit test modules")
|
||||||
|
add_option(ENABLE_FUZZ_TESTS "Enables the building of the fuzz test modules")
|
||||||
|
|
||||||
add_option(ENABLE_STATIC_ANALYSIS "Makes clang-tidy checks mandatory for compilation")
|
add_option(ENABLE_STATIC_ANALYSIS "Makes clang-tidy checks mandatory for compilation")
|
||||||
if (ENABLE_STATIC_ANALYSIS)
|
if (ENABLE_STATIC_ANALYSIS)
|
||||||
|
|
|
@ -11,7 +11,8 @@ class LightRecipe(ConanFile):
|
||||||
generators = "CMakeDeps"
|
generators = "CMakeDeps"
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"enable_tests": [True, False],
|
"enable_unit_tests": [True, False],
|
||||||
|
"enable_fuzz_tests": [True, False],
|
||||||
"enable_llvm_coverage": [True, False],
|
"enable_llvm_coverage": [True, False],
|
||||||
"enable_static_analysis": [True, False],
|
"enable_static_analysis": [True, False],
|
||||||
"use_mold": [True, False],
|
"use_mold": [True, False],
|
||||||
|
@ -19,7 +20,8 @@ class LightRecipe(ConanFile):
|
||||||
}
|
}
|
||||||
|
|
||||||
default_options = {
|
default_options = {
|
||||||
"enable_tests": True,
|
"enable_unit_tests": True,
|
||||||
|
"enable_fuzz_tests": False,
|
||||||
"enable_llvm_coverage": False,
|
"enable_llvm_coverage": False,
|
||||||
"enable_static_analysis": False,
|
"enable_static_analysis": False,
|
||||||
"use_mold": False,
|
"use_mold": False,
|
||||||
|
@ -46,7 +48,8 @@ class LightRecipe(ConanFile):
|
||||||
tc.cache_variables["CMAKE_LINKER_TYPE"] = "MOLD"
|
tc.cache_variables["CMAKE_LINKER_TYPE"] = "MOLD"
|
||||||
|
|
||||||
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = self.options.export_compile_commands
|
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = self.options.export_compile_commands
|
||||||
tc.cache_variables["ENABLE_TESTS"] = self.options.enable_tests
|
tc.cache_variables["ENABLE_UNIT_TESTS"] = self.options.enable_unit_tests
|
||||||
|
tc.cache_variables["ENABLE_FUZZ_TESTS"] = self.options.enable_fuzz_tests
|
||||||
tc.cache_variables["ENABLE_LLVM_COVERAGE"] = self.options.enable_llvm_coverage
|
tc.cache_variables["ENABLE_LLVM_COVERAGE"] = self.options.enable_llvm_coverage
|
||||||
tc.cache_variables["ENABLE_STATIC_ANALYSIS"] = self.options.enable_static_analysis
|
tc.cache_variables["ENABLE_STATIC_ANALYSIS"] = self.options.enable_static_analysis
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ RUN pacman -S --noconfirm --disable-download-timeout \
|
||||||
curl \
|
curl \
|
||||||
wget \
|
wget \
|
||||||
zlib \
|
zlib \
|
||||||
libc++
|
libc++ \
|
||||||
|
libinput
|
||||||
|
|
||||||
RUN pip install --no-cache-dir --break-system-packages conan gitpython \
|
RUN pip install --no-cache-dir --break-system-packages conan gitpython \
|
||||||
&& conan profile detect
|
&& conan profile detect
|
||||||
|
@ -37,7 +38,7 @@ RUN pip --version \
|
||||||
&& llvm-cov --version
|
&& llvm-cov --version
|
||||||
|
|
||||||
RUN git clone 'https://git.light7734.com/light7734/light.git' \
|
RUN git clone 'https://git.light7734.com/light7734/light.git' \
|
||||||
&& cd light; git checkout 'ci/code_cov' \
|
&& cd light \
|
||||||
&& conan build . \
|
&& conan build . \
|
||||||
-c tools.system.package_manager:mode=install \
|
-c tools.system.package_manager:mode=install \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
|
|
|
@ -4,6 +4,9 @@ set -e
|
||||||
cd $(git rev-parse --show-toplevel)/
|
cd $(git rev-parse --show-toplevel)/
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
|
|
||||||
|
Xvfb :99 -screen 0 1024x768x16 &
|
||||||
|
export DISPLAY=:99
|
||||||
|
|
||||||
conan build . \
|
conan build . \
|
||||||
-c tools.system.package_manager:mode=install \
|
-c tools.system.package_manager:mode=install \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
|
|
|
@ -8,7 +8,7 @@ conan build . \
|
||||||
-c tools.system.package_manager:mode=install \
|
-c tools.system.package_manager:mode=install \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
-s build_type=Release \
|
-s build_type=Release \
|
||||||
-o enable_tests=True \
|
-o enable_unit_tests=True \
|
||||||
-o use_mold=True \
|
-o use_mold=True \
|
||||||
--build=missing
|
--build=missing
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ conan build . \
|
||||||
-c tools.system.package_manager:mode=install \
|
-c tools.system.package_manager:mode=install \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
-s build_type=Release \
|
-s build_type=Release \
|
||||||
-o enable_tests=True \
|
-o enable_unit_tests=True \
|
||||||
-o use_mold=True \
|
-o use_mold=True \
|
||||||
--build=missing
|
--build=missing
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ conan build . \
|
||||||
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
-c tools.cmake.cmaketoolchain:generator=Ninja \
|
||||||
-s build_type=Release \
|
-s build_type=Release \
|
||||||
-o enable_static_analysis=True \
|
-o enable_static_analysis=True \
|
||||||
-o enable_tests=True \
|
-o enable_unit_tests=True \
|
||||||
|
-o enable_fuzz_tests=True \
|
||||||
-o use_mold=True \
|
-o use_mold=True \
|
||||||
--build=missing
|
--build=missing
|
||||||
|
|
|
@ -78,7 +78,7 @@ function (add_executable_module exename)
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
function (add_test_module target_lib_name)
|
function (add_test_module target_lib_name)
|
||||||
if (NOT ${ENABLE_TESTS})
|
if (NOT ${ENABLE_UNIT_TESTS})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ function (add_test_module target_lib_name)
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
function (add_fuzz_module target_lib_name)
|
function (add_fuzz_module target_lib_name)
|
||||||
if (NOT ${ENABLE_TESTS})
|
if (NOT ${ENABLE_FUZZ_TESTS})
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue