forked from XRPLF/clio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from XRPLF/develop
Clio updates
- Loading branch information
Showing
117 changed files
with
8,167 additions
and
5,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 50% | ||
threshold: 2% | ||
|
||
patch: | ||
default: | ||
target: 20% # Need to bump this number https://docs.codecov.com/docs/commit-status#patch-status | ||
threshold: 2% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,18 @@ | ||
name: Build clio | ||
description: Build clio in build directory | ||
inputs: | ||
conan_profile: | ||
description: Conan profile name | ||
required: true | ||
default: default | ||
conan_cache_hit: | ||
description: Whether conan cache has been downloaded | ||
required: true | ||
target: | ||
description: Build target name | ||
default: all | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Get number of threads on mac | ||
id: mac_threads | ||
if: ${{ runner.os == 'macOS' }} | ||
shell: bash | ||
run: echo "num=$(($(sysctl -n hw.logicalcpu) - 2))" >> $GITHUB_OUTPUT | ||
|
||
- name: Get number of threads on Linux | ||
id: linux_threads | ||
if: ${{ runner.os == 'Linux' }} | ||
shell: bash | ||
run: echo "num=$(($(nproc) - 2))" >> $GITHUB_OUTPUT | ||
- name: Get number of threads | ||
uses: ./.github/actions/get_number_of_threads | ||
id: number_of_threads | ||
|
||
- name: Build Clio | ||
shell: bash | ||
env: | ||
BUILD_OPTION: "${{ inputs.conan_cache_hit == 'true' && 'missing' || '' }}" | ||
LINT: "${{ runner.os == 'Linux' && 'True' || 'False' }}" | ||
run: | | ||
mkdir -p build | ||
cd build | ||
threads_num=${{ steps.mac_threads.outputs.num || steps.linux_threads.outputs.num }} | ||
conan install .. -of . -b $BUILD_OPTION -s build_type=Release -o clio:tests=True -o clio:lint=$LINT --profile ${{ inputs.conan_profile }} | ||
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja | ||
cmake --build . --parallel $threads_num | ||
cmake --build . --parallel ${{ steps.number_of_threads.outputs.threads_number }} --target ${{ inputs.target }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Generate code coverage report | ||
description: Run tests, generate code coverage report and upload it to codecov.io | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
build/clio_tests --gtest_filter="-BackendCassandraBaseTest*:BackendCassandraTest*:BackendCassandraFactoryTestWithDB*" | ||
- name: Run gcovr | ||
shell: bash | ||
run: | | ||
gcovr -e unittests --xml build/coverage_report.xml -j8 --exclude-throw-branches | ||
- name: Archive coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-report.xml | ||
path: build/coverage_report.xml | ||
retention-days: 30 | ||
|
||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: build/coverage_report.xml | ||
fail_ci_if_error: true | ||
verbose: true | ||
token: ${{ env.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Run conan and cmake | ||
description: Run conan and cmake | ||
inputs: | ||
conan_profile: | ||
description: Conan profile name | ||
required: true | ||
conan_cache_hit: | ||
description: Whether conan cache has been downloaded | ||
required: true | ||
default: 'false' | ||
build_type: | ||
description: Build type for third-party libraries and clio. Could be 'Release', 'Debug' | ||
required: true | ||
default: 'Release' | ||
code_coverage: | ||
description: Whether conan's coverage option should be on or not | ||
required: true | ||
default: 'false' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Create build directory | ||
shell: bash | ||
run: mkdir -p build | ||
|
||
- name: Run conan | ||
shell: bash | ||
env: | ||
BUILD_OPTION: "${{ inputs.conan_cache_hit == 'true' && 'missing' || '' }}" | ||
CODE_COVERAGE: "${{ inputs.code_coverage == 'true' && 'True' || 'False' }}" | ||
run: | | ||
cd build | ||
conan install .. -of . -b $BUILD_OPTION -s build_type=${{ inputs.build_type }} -o clio:tests=True -o clio:lint=False -o clio:coverage="${CODE_COVERAGE}" --profile ${{ inputs.conan_profile }} | ||
- name: Run cmake | ||
shell: bash | ||
env: | ||
BUILD_TYPE: "${{ inputs.build_type }}" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Get number of threads | ||
description: Determines number of threads to use on macOS and Linux | ||
outputs: | ||
threads_number: | ||
description: Number of threads to use | ||
value: ${{ steps.number_of_threads_export.outputs.num }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Get number of threads on mac | ||
id: mac_threads | ||
if: ${{ runner.os == 'macOS' }} | ||
shell: bash | ||
run: echo "num=$(($(sysctl -n hw.logicalcpu) - 2))" >> $GITHUB_OUTPUT | ||
|
||
- name: Get number of threads on Linux | ||
id: linux_threads | ||
if: ${{ runner.os == 'Linux' }} | ||
shell: bash | ||
run: echo "num=$(($(nproc) - 2))" >> $GITHUB_OUTPUT | ||
|
||
- name: Export output variable | ||
shell: bash | ||
id: number_of_threads_export | ||
run: | | ||
echo "num=${{ steps.mac_threads.outputs.num || steps.linux_threads.outputs.num }}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Prepare runner | ||
description: Install packages, set environment variables, create directories | ||
inputs: | ||
disable_ccache: | ||
description: Whether ccache should be disabled | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install packages on mac | ||
if: ${{ runner.os == 'macOS' }} | ||
shell: bash | ||
run: | | ||
brew install llvm@14 pkg-config ninja bison cmake ccache jq gh | ||
- name: Fix git permissions on Linux | ||
if: ${{ runner.os == 'Linux' }} | ||
shell: bash | ||
run: git config --global --add safe.directory $PWD | ||
|
||
- name: Set env variables for macOS | ||
if: ${{ runner.os == 'macOS' }} | ||
shell: bash | ||
run: | | ||
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV | ||
echo "CONAN_USER_HOME=${{ github.workspace }}" >> $GITHUB_ENV | ||
- name: Set env variables for Linux | ||
if: ${{ runner.os == 'Linux' }} | ||
shell: bash | ||
run: | | ||
echo "CCACHE_DIR=/root/.ccache" >> $GITHUB_ENV | ||
echo "CONAN_USER_HOME=/root/" >> $GITHUB_ENV | ||
- name: Set CCACHE_DISABLE=1 | ||
if: ${{ inputs.disable_ccache == 'true' }} | ||
shell: bash | ||
run: | | ||
echo "CCACHE_DISABLE=1" >> $GITHUB_ENV | ||
- name: Create directories | ||
shell: bash | ||
run: | | ||
mkdir -p $CCACHE_DIR | ||
mkdir -p $CONAN_USER_HOME/.conan | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.