Skip to content

Commit

Permalink
Merge pull request #2279 from AntelopeIO/assert_ci
Browse files Browse the repository at this point in the history
add a CI "platform" with `assert()`s enabled (`NDEBUG` not defined)
  • Loading branch information
spoonincode authored Mar 5, 2024
2 parents 006583a + 301d7cb commit 7382d88
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .cicd/platforms/asserton.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# syntax=docker/dockerfile:1
#the exact version of Ubuntu doesn't matter for the purpose of asserton builds. Feel free to upgrade in future
FROM ubuntu:jammy
ENV TZ="America/New_York"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y build-essential \
cmake \
git \
jq \
libcurl4-openssl-dev \
libgmp-dev \
llvm-11-dev \
ninja-build \
python3-numpy \
file \
zlib1g-dev \
zstd

ENV LEAP_PLATFORM_HAS_EXTRAS_CMAKE=1
COPY <<-EOF /extras.cmake
# reset the build type to empty to disable any cmake default flags
set(CMAKE_BUILD_TYPE "" CACHE STRING "" FORCE)

set(CMAKE_C_FLAGS "-O3" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-O3" CACHE STRING "")

set(LEAP_ENABLE_RELEASE_BUILD_TEST "Off" CACHE BOOL "")
EOF
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:
include:
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'}
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'}
- cfg: {name: 'asserton', base: 'asserton', builddir: 'asserton'}
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'}
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'}
runs-on: ["self-hosted", "enf-x86-hightier"]
Expand Down Expand Up @@ -174,6 +175,7 @@ jobs:
include:
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'}
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'}
- cfg: {name: 'asserton', base: 'asserton', builddir: 'asserton'}
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'}
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'}
runs-on: ["self-hosted", "enf-x86-midtier"]
Expand Down Expand Up @@ -213,6 +215,7 @@ jobs:
include:
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'}
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'}
- cfg: {name: 'asserton', base: 'asserton', builddir: 'asserton'}
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'}
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'}
runs-on: ["self-hosted", "enf-x86-lowtier"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LEAP_DEV_DEB=On -GNinja
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LEAP_DEV_DEB=On ${LEAP_PLATFORM_HAS_EXTRAS_CMAKE:+-C /extras.cmake} -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
Expand Down
6 changes: 5 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ else()
set(UNSHARE "")
endif()

option(LEAP_ENABLE_RELEASE_BUILD_TEST "Enables a test that verifies nodeos was compiled with compiler options typical for a release build" On)
if(LEAP_ENABLE_RELEASE_BUILD_TEST)
add_test(NAME release-build-test COMMAND tests/release-build.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

#To run plugin_test with all log from blockchain displayed, put --verbose after --, i.e. plugin_test -- --verbose
add_test(NAME plugin_test COMMAND plugin_test --report_level=detailed --color_output)

Expand Down Expand Up @@ -179,7 +184,6 @@ set_property(TEST trx_finality_status_forked_test PROPERTY LABELS nonparalleliza

add_test(NAME db_modes_test COMMAND tests/db_modes_test.sh -v WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(db_modes_test PROPERTIES COST 6000)
add_test(NAME release-build-test COMMAND tests/release-build.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME version-label-test COMMAND tests/version-label.sh "v${VERSION_FULL}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME full-version-label-test COMMAND tests/full-version-label.sh "v${VERSION_FULL}" ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME nested_container_multi_index_test COMMAND tests/nested_container_multi_index_test.py -n 2 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down

0 comments on commit 7382d88

Please sign in to comment.