From f6488f70242b00633300752ceec98e61c2ec03cc Mon Sep 17 00:00:00 2001 From: Michael Legleux Date: Mon, 7 Aug 2023 12:53:20 -0700 Subject: [PATCH] Fix Linux/gcc build on CI (#813) --- .github/actions/linux_build/build.sh | 20 ++++++++ .github/workflows/build.yml | 74 ++++++++++++++++++++++++---- 2 files changed, 84 insertions(+), 10 deletions(-) create mode 100755 .github/actions/linux_build/build.sh diff --git a/.github/actions/linux_build/build.sh b/.github/actions/linux_build/build.sh new file mode 100755 index 00000000..d928e555 --- /dev/null +++ b/.github/actions/linux_build/build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +conan profile new default --detect +conan profile update settings.compiler.cppstd=20 default +conan profile update settings.compiler.libcxx=libstdc++11 default +conan remote add --insert 0 conan-non-prod http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod + +cd rippled +conan export external/snappy snappy/1.1.10@ +conan export external/soci soci/4.0.3@ +conan export . +conan install --output-folder build_rippled -install-folder build_rippled --build missing --settings build_type=Release +cmake -B build_rippled -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release +cmake --build build_rippled --target xrpl_core --parallel $(($(nproc) - 2)) +cd .. + +conan export external/cassandra +conan install . -if build_clio -of build_clio --build missing --settings build_type=Release -o tests=True +cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -B build_clio +cmake --build build_clio --parallel $(($(nproc) - 2)) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c7b7f51..30e6e4f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: Build Clio on: push: - branches: [master, release/*, develop, develop-next] + branches: [master, release/*, develop] pull_request: - branches: [master, release/*, develop, develop-next] + branches: [master, release/*, develop] workflow_dispatch: jobs: @@ -15,11 +15,11 @@ jobs: - name: Run clang-format uses: ./.github/actions/lint - build_dev: - name: Build on Mac/Clang14 and run tests - continue-on-error: false - runs-on: [self-hosted, macOS] + build_mac: + name: Build macOS needs: lint + continue-on-error: true + runs-on: [self-hosted, macOS] steps: - uses: actions/checkout@v3 with: @@ -53,9 +53,63 @@ jobs: cd build conan install .. -of . -b missing -s build_type=Release -o clio:tests=True cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. - cmake --build . -j4 + cmake --build . --parallel $(($(sysctl -n hw.logicalcpu) - 2)) - - name: Run Test + - name: Upload clio_tests + uses: actions/upload-artifact@v3 + with: + name: clio_tests_mac + path: ./clio/build/clio_tests + + build_linux: + name: Build linux + needs: lint + continue-on-error: true + runs-on: [self-hosted, Linux] + container: + image: conanio/gcc11:1.60.2 + options: --user root + steps: + - name: Get Clio + uses: actions/checkout@v3 + + - name: Get rippled + uses: actions/checkout@v3 + with: + repository: thejohnfreeman/rippled + ref: clio + path: rippled + + - name: Build Clio run: | - cd clio/build - ./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*" + ./.github/actions/linux_build/build.sh + + - name: Upload clio_tests + uses: actions/upload-artifact@v3 + with: + name: clio_tests_linux + path: ./build_clio/clio_tests + + test_mac: + needs: build_mac + runs-on: [self-hosted, macOS] + steps: + - uses: actions/download-artifact@v3 + with: + name: clio_tests_mac + - name: Run clio_tests + run: | + chmod +x ./clio_tests + ./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*" + + test_linux: + needs: build_linux + runs-on: [self-hosted, x-heavy] + steps: + - uses: actions/download-artifact@v3 + with: + name: clio_tests_linux + - name: Run clio_tests + run: | + chmod +x ./clio_tests + ./clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*"