Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
427ba47
chore: Fix error in grafana dashboard example (#1878)
kuznetsss Feb 7, 2025
f5e6c95
feat: Run tests with sanitizers in CI (#1879)
godexsoft Feb 10, 2025
cd6289b
feat: Generate config descriptions (#1842)
PeterChen13579 Feb 10, 2025
b5fe22d
style: clang-tidy auto fixes (#1889)
github-actions[bot] Feb 11, 2025
cd1aa8f
chore: Revert workflow names (#1890)
godexsoft Feb 11, 2025
e503dff
fix: Array parsing in new config (#1884)
kuznetsss Feb 12, 2025
624f7ff
feat: Support Simulate (#1891)
PeterChen13579 Feb 12, 2025
3c008b6
feat: Snapshot exporting tool (#1877)
cindyyan317 Feb 12, 2025
531e1da
ci: Upload cache only for develop branch (#1897)
kuznetsss Feb 14, 2025
fcebd71
test: add non-admin test for simulate (#1893)
PeterChen13579 Feb 14, 2025
4b17880
fix: Array parsing in new config (#1896)
kuznetsss Feb 18, 2025
25296f8
fix: Better errors on logger init failure (#1857)
kuznetsss Feb 18, 2025
491cd58
feat: ETLng monitor (#1898)
godexsoft Feb 21, 2025
f577139
style: clang-tidy auto fixes (#1920)
github-actions[bot] Feb 24, 2025
c9e8330
feat: LPT freeze (#1840)
shawnxie999 Feb 24, 2025
918a92e
style: clang-tidy auto fixes (#1925)
github-actions[bot] Feb 25, 2025
b909b88
fix: Fix backtrace usage (#1932)
kuznetsss Feb 27, 2025
d11e7bc
fix: Data race in new webserver (#1926)
kuznetsss Feb 27, 2025
f0613c9
ci: Use ubuntu latest for some ci jobs (#1939)
kuznetsss Mar 4, 2025
86e2cd1
feat: Add workflow to check config description (#1894)
PeterChen13579 Mar 4, 2025
f7db030
fix: Fix dangling reference in new web server (#1938)
kuznetsss Mar 4, 2025
915a8be
style: Use error code instead of exception when parsing json (#1942)
kuznetsss Mar 4, 2025
98ff72b
fix: change math/rand to crypto/rand (#1941)
PeterChen13579 Mar 5, 2025
5d2694d
chore: update libxrpl (#1943)
PeterChen13579 Mar 5, 2025
8a08c5e
feat: Add support for deep freeze (#1875)
PeterChen13579 Mar 5, 2025
c57fe1e
test: Add assert mock to avoid death tests (#1947)
kuznetsss Mar 7, 2025
a34d565
style: clang-tidy auto fixes (#1949)
github-actions[bot] Mar 10, 2025
a46d700
fix: Improve error message when starting read only mode with empty DB…
kuznetsss Mar 10, 2025
2684237
fix: Fix url check in config (#1953)
kuznetsss Mar 11, 2025
41fc677
Merge branch 'release/2.4.0' into chore/commits-for-2.4.0-b4
kuznetsss Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/build_clio/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ inputs:
target:
description: Build target name
default: all
substract_threads:
description: An option for the action get_number_of_threads. See get_number_of_threads
required: true
default: '0'
runs:
using: composite
steps:
- name: Get number of threads
uses: ./.github/actions/get_number_of_threads
id: number_of_threads
with:
substract_threads: ${{ inputs.substract_threads }}

- name: Build Clio
shell: bash
Expand Down
20 changes: 17 additions & 3 deletions .github/actions/generate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
description: Build type for third-party libraries and clio. Could be 'Release', 'Debug'
required: true
default: 'Release'
build_integration_tests:
description: Whether to build integration tests
required: true
default: 'true'
code_coverage:
description: Whether conan's coverage option should be on or not
required: true
Expand All @@ -20,6 +24,10 @@ inputs:
description: Whether Clio is to be statically linked
required: true
default: 'false'
sanitizer:
description: Sanitizer to use
required: true
default: 'false' # false, tsan, asan or ubsan
runs:
using: composite
steps:
Expand All @@ -33,14 +41,20 @@ runs:
BUILD_OPTION: "${{ inputs.conan_cache_hit == 'true' && 'missing' || '' }}"
CODE_COVERAGE: "${{ inputs.code_coverage == 'true' && 'True' || 'False' }}"
STATIC_OPTION: "${{ inputs.static == 'true' && 'True' || 'False' }}"
INTEGRATION_TESTS_OPTION: "${{ inputs.build_integration_tests == 'true' && 'True' || 'False' }}"
run: |
cd build
conan install .. -of . -b $BUILD_OPTION -s build_type=${{ inputs.build_type }} -o clio:static="${STATIC_OPTION}" -o clio:tests=True -o clio:integration_tests=True -o clio:lint=False -o clio:coverage="${CODE_COVERAGE}" --profile ${{ inputs.conan_profile }}

conan install .. -of . -b $BUILD_OPTION -s build_type=${{ inputs.build_type }} -o clio:static="${STATIC_OPTION}" -o clio:tests=True -o clio:integration_tests="${INTEGRATION_TESTS_OPTION}" -o clio:lint=False -o clio:coverage="${CODE_COVERAGE}" --profile ${{ inputs.conan_profile }}
- name: Run cmake
shell: bash
env:
BUILD_TYPE: "${{ inputs.build_type }}"
SANITIZER_OPTION: |
${{ inputs.sanitizer == 'tsan' && '-Dsan=thread' ||
inputs.sanitizer == 'ubsan' && '-Dsan=undefined' ||
inputs.sanitizer == 'asan' && '-Dsan=address' ||
'' }}
run: |
cd build
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} ${{ inputs.extra_cmake_args }} .. -G Ninja
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ${SANITIZER_OPTION} .. -G Ninja
14 changes: 11 additions & 3 deletions .github/actions/get_number_of_threads/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Get number of threads
description: Determines number of threads to use on macOS and Linux
inputs:
substract_threads:
description: How many threads to substract from the calculated number
required: true
default: '0'
outputs:
threads_number:
description: Number of threads to use
Expand All @@ -19,8 +24,11 @@ runs:
shell: bash
run: echo "num=$(($(nproc) - 2))" >> $GITHUB_OUTPUT

- name: Export output variable
shell: bash
- name: Shift and export number of threads
id: number_of_threads_export
shell: bash
run: |
echo "num=${{ steps.mac_threads.outputs.num || steps.linux_threads.outputs.num }}" >> $GITHUB_OUTPUT
num_of_threads=${{ steps.mac_threads.outputs.num || steps.linux_threads.outputs.num }}
shift_by=${{ inputs.substract_threads }}
shifted=$((num_of_threads - shift_by))
echo "num=$(( shifted > 1 ? shifted : 1 ))" >> $GITHUB_OUTPUT
45 changes: 45 additions & 0 deletions .github/scripts/execute-tests-under-sanitizer
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

set -o pipefail

# Note: This script is intended to be run from the root of the repository.
#
# This script runs each unit-test separately and generates reports from the currently active sanitizer.
# Output is saved in ./.sanitizer-report in the root of the repository

if [[ -z "$1" ]]; then
cat <<EOF

ERROR
-----------------------------------------------------------------------------
Path to clio_tests should be passed as first argument to the script.
-----------------------------------------------------------------------------

EOF
exit 1
fi

TEST_BINARY=$1

if [[ ! -f "$TEST_BINARY" ]]; then
echo "Test binary not found: $TEST_BINARY"
exit 1
fi

TESTS=$($TEST_BINARY --gtest_list_tests | awk '/^ / {print suite $1} !/^ / {suite=$1}')

OUTPUT_DIR="./.sanitizer-report"
mkdir -p "$OUTPUT_DIR"

for TEST in $TESTS; do
OUTPUT_FILE="$OUTPUT_DIR/${TEST//\//_}"
export TSAN_OPTIONS="log_path=\"$OUTPUT_FILE\" die_after_fork=0"
export ASAN_OPTIONS="log_path=\"$OUTPUT_FILE\""
export UBSAN_OPTIONS="log_path=\"$OUTPUT_FILE\""
export MallocNanoZone='0' # for MacOSX
$TEST_BINARY --gtest_filter="$TEST" > /dev/null 2>&1

if [ $? -ne 0 ]; then
echo "'$TEST' failed a sanitizer check."
fi
done
182 changes: 67 additions & 115 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
check_format:
name: Check format
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: rippleci/clio_ci:latest
steps:
Expand All @@ -26,7 +26,7 @@ jobs:

check_docs:
name: Check documentation
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: rippleci/clio_ci:latest
steps:
Expand All @@ -47,133 +47,44 @@ jobs:
matrix:
include:
- os: heavy
container:
image: rippleci/clio_ci:latest
build_type: Release
conan_profile: gcc
build_type: Release
container: '{ "image": "rippleci/clio_ci:latest" }'
code_coverage: false
static: true
- os: heavy
container:
image: rippleci/clio_ci:latest
build_type: Debug
conan_profile: gcc
build_type: Debug
container: '{ "image": "rippleci/clio_ci:latest" }'
code_coverage: true
static: true
- os: heavy
container:
image: rippleci/clio_ci:latest
build_type: Release
conan_profile: clang
build_type: Release
container: '{ "image": "rippleci/clio_ci:latest" }'
code_coverage: false
static: true
- os: heavy
container:
image: rippleci/clio_ci:latest
build_type: Debug
conan_profile: clang
build_type: Debug
container: '{ "image": "rippleci/clio_ci:latest" }'
code_coverage: false
static: true
- os: macos15
build_type: Release
code_coverage: false
static: false
runs-on: [self-hosted, "${{ matrix.os }}"]
container: ${{ matrix.container }}

steps:
- name: Clean workdir
if: ${{ runner.os == 'macOS' }}
uses: kuznetsss/workspace-cleanup@1.0

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare runner
uses: ./.github/actions/prepare_runner
with:
disable_ccache: false

- name: Setup conan
uses: ./.github/actions/setup_conan
id: conan
with:
conan_profile: ${{ matrix.conan_profile }}

- name: Restore cache
uses: ./.github/actions/restore_cache
id: restore_cache
with:
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
conan_profile: ${{ steps.conan.outputs.conan_profile }}
ccache_dir: ${{ env.CCACHE_DIR }}
build_type: ${{ matrix.build_type }}
code_coverage: ${{ matrix.code_coverage }}

- name: Run conan and cmake
uses: ./.github/actions/generate
with:
conan_profile: ${{ steps.conan.outputs.conan_profile }}
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
build_type: ${{ matrix.build_type }}
code_coverage: ${{ matrix.code_coverage }}
static: ${{ matrix.static }}

- name: Build Clio
uses: ./.github/actions/build_clio

- name: Show ccache's statistics
shell: bash
id: ccache_stats
run: |
ccache -s > /tmp/ccache.stats
miss_rate=$(cat /tmp/ccache.stats | grep 'Misses' | head -n1 | sed 's/.*(\(.*\)%).*/\1/')
echo "miss_rate=${miss_rate}" >> $GITHUB_OUTPUT
cat /tmp/ccache.stats

- name: Strip tests
if: ${{ !matrix.code_coverage }}
run: strip build/clio_tests && strip build/clio_integration_tests

- name: Upload clio_server
uses: actions/upload-artifact@v4
with:
name: clio_server_${{ runner.os }}_${{ matrix.build_type }}_${{ steps.conan.outputs.conan_profile }}
path: build/clio_server

- name: Upload clio_tests
if: ${{ !matrix.code_coverage }}
uses: actions/upload-artifact@v4
with:
name: clio_tests_${{ runner.os }}_${{ matrix.build_type }}_${{ steps.conan.outputs.conan_profile }}
path: build/clio_*tests

- name: Save cache
uses: ./.github/actions/save_cache
with:
conan_dir: ${{ env.CONAN_USER_HOME }}/.conan
conan_hash: ${{ steps.restore_cache.outputs.conan_hash }}
conan_cache_hit: ${{ steps.restore_cache.outputs.conan_cache_hit }}
ccache_dir: ${{ env.CCACHE_DIR }}
ccache_cache_hit: ${{ steps.restore_cache.outputs.ccache_cache_hit }}
ccache_cache_miss_rate: ${{ steps.ccache_stats.outputs.miss_rate }}
build_type: ${{ matrix.build_type }}
code_coverage: ${{ matrix.code_coverage }}
conan_profile: ${{ steps.conan.outputs.conan_profile }}

# TODO: This is not a part of build process but it is the easiest way to do it here.
# It will be refactored in https://github.com/XRPLF/clio/issues/1075
- name: Run code coverage
if: ${{ matrix.code_coverage }}
uses: ./.github/actions/code_coverage

upload_coverage_report:
name: Codecov
needs: build
uses: ./.github/workflows/upload_coverage_report.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: ./.github/workflows/build_impl.yml
with:
runs_on: ${{ matrix.os }}
container: ${{ matrix.container }}
conan_profile: ${{ matrix.conan_profile }}
build_type: ${{ matrix.build_type }}
code_coverage: ${{ matrix.code_coverage }}
static: ${{ matrix.static }}
unit_tests: true
integration_tests: true
clio_server: true

test:
name: Run Tests
Expand All @@ -183,24 +94,24 @@ jobs:
matrix:
include:
- os: heavy
container:
image: rippleci/clio_ci:latest
conan_profile: gcc
build_type: Release
- os: heavy
container:
image: rippleci/clio_ci:latest
- os: heavy
conan_profile: clang
build_type: Release
- os: heavy
container:
image: rippleci/clio_ci:latest
- os: heavy
conan_profile: clang
build_type: Debug
container:
image: rippleci/clio_ci:latest
- os: macos15
conan_profile: apple_clang_16
build_type: Release
runs-on: [self-hosted, "${{ matrix.os }}"]
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}

steps:
Expand All @@ -216,3 +127,44 @@ jobs:
run: |
chmod +x ./clio_tests
./clio_tests

check_config:
name: Check Config Description
needs: build
runs-on: heavy
container:
image: rippleci/clio_ci:latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: clio_server_Linux_Release_gcc
- name: Compare Config Description
shell: bash
run: |
repoConfigFile=docs/config-description.md
if ! [ -f ${repoConfigFile} ]; then
echo "Config Description markdown file is missing in docs folder"
exit 1
fi

chmod +x ./clio_server
configDescriptionFile=config_description_new.md
./clio_server -d ${configDescriptionFile}

configDescriptionHash=$(sha256sum ${configDescriptionFile} | cut -d' ' -f1)
repoConfigHash=$(sha256sum ${repoConfigFile} | cut -d' ' -f1)

if [ ${configDescriptionHash} != ${repoConfigHash} ]; then
echo "Markdown file is not up to date"
diff -u "${repoConfigFile}" "${configDescriptionFile}"
rm -f ${configDescriptionFile}
exit 1
fi
rm -f ${configDescriptionFile}
exit 0





2 changes: 1 addition & 1 deletion .github/workflows/build_clio_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ on:
jobs:
build_and_publish_image:
name: Build and publish image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand Down
Loading
Loading