diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 24650858f9..09f7f25271 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -101,11 +101,27 @@ jobs: --parallel $(nproc) \ --target "${CMAKE_TARGET}" + - name: Put built binaries in one location + shell: bash + working-directory: ${{ inputs.build_dir }} + env: + BUILD_TYPE_DIR: ${{ runner.os == 'Windows' && inputs.build_type || '' }} + CMAKE_TARGET: ${{ inputs.cmake_target }} + run: | + mkdir -p ./binaries/doctest/ + + cp ./${BUILD_TYPE_DIR}/rippled* ./binaries/ + if [ "${CMAKE_TARGET}" != 'coverage' ]; then + cp ./src/tests/libxrpl/${BUILD_TYPE_DIR}/xrpl.test.* ./binaries/doctest/ + fi + - name: Upload rippled artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + env: + BUILD_DIR: ${{ inputs.build_dir }} with: name: rippled-${{ inputs.config_name }} - path: ${{ inputs.build_dir }}/${{ runner.os == 'Windows' && inputs.build_type || '' }}/rippled${{ runner.os == 'Windows' && '.exe' || '' }} + path: ${{ env.BUILD_DIR }}/binaries/ retention-days: 3 if-no-files-found: error diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index eb6a0271a4..cfd0fe6849 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -33,6 +33,10 @@ jobs: container: ${{ inputs.image != '' && inputs.image || null }} timeout-minutes: 30 steps: + - name: Cleanup workspace + if: ${{ runner.os == 'macOS' }} + uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e + - name: Download rippled artifact uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: @@ -62,9 +66,22 @@ jobs: run: | ./rippled --version | grep libvoidstar - - name: Test the binary + - name: Run the embedded tests if: ${{ inputs.run_tests }} shell: bash run: | ./rippled --unittest --unittest-jobs $(nproc) - ctest -j $(nproc) --output-on-failure + + - name: Run the separate tests + if: ${{ inputs.run_tests }} + shell: bash + run: | + for test_file in ./doctest/*; do + echo "Executing $test_file" + chmod +x "$test_file" + if [[ "${{ runner.os }}" == "Windows" && "$test_file" == "./doctest/xrpl.test.net.exe" ]]; then + echo "Skipping $test_file on Windows" + else + "$test_file" + fi + done diff --git a/cmake/xrpl_add_test.cmake b/cmake/xrpl_add_test.cmake index d61f4ece3d..a1dd3847bd 100644 --- a/cmake/xrpl_add_test.cmake +++ b/cmake/xrpl_add_test.cmake @@ -7,7 +7,7 @@ function(xrpl_add_test name) "${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp" ) - add_executable(${target} EXCLUDE_FROM_ALL ${ARGN} ${sources}) + add_executable(${target} ${ARGN} ${sources}) isolate_headers( ${target}