mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-19 19:25:53 +00:00
style: Use pre-commit tool and add simple config (#2029)
I started with really simple pre-commit hooks and will add more on top. Important files: - `.pre-commit-config.yaml` - the config for pre-commit - `.github/workflows/pre-commit.yml` - runs pre-commit hooks in branches and `develop` - `.github/workflows/pre-commit-autoupdate.yml` - autoupdates pre-commit hooks once in a month
This commit is contained in:
2
.github/actions/build_clio/action.yml
vendored
2
.github/actions/build_clio/action.yml
vendored
@@ -5,7 +5,7 @@ inputs:
|
||||
description: Build target name
|
||||
default: all
|
||||
substract_threads:
|
||||
description: An option for the action get_number_of_threads. See get_number_of_threads
|
||||
description: An option for the action get_number_of_threads. See get_number_of_threads
|
||||
required: true
|
||||
default: '0'
|
||||
runs:
|
||||
|
||||
@@ -38,6 +38,8 @@ runs:
|
||||
password: ${{ env.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0
|
||||
with:
|
||||
cache-image: false
|
||||
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 #v3.10.0
|
||||
|
||||
- uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 #v5.7.0
|
||||
@@ -63,4 +65,3 @@ runs:
|
||||
repository: ${{ inputs.image_name }}
|
||||
short-description: ${{ inputs.description }}
|
||||
readme-filepath: ${{ inputs.directory }}/README.md
|
||||
|
||||
|
||||
2
.github/actions/generate/action.yml
vendored
2
.github/actions/generate/action.yml
vendored
@@ -45,7 +45,7 @@ runs:
|
||||
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="${INTEGRATION_TESTS_OPTION}" -o clio:lint=False -o clio:coverage="${CODE_COVERAGE}" --profile ${{ inputs.conan_profile }}
|
||||
|
||||
|
||||
- name: Run cmake
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -2,7 +2,7 @@ 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
|
||||
description: How many threads to substract from the calculated number
|
||||
required: true
|
||||
default: '0'
|
||||
outputs:
|
||||
|
||||
10
.github/actions/prepare_runner/action.yml
vendored
10
.github/actions/prepare_runner/action.yml
vendored
@@ -20,14 +20,14 @@ runs:
|
||||
run: |
|
||||
# Uninstall any existing cmake
|
||||
brew uninstall cmake --ignore-dependencies || true
|
||||
|
||||
|
||||
# Download specific cmake formula
|
||||
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/b4e46db74e74a8c1650b38b1da222284ce1ec5ce/Formula/c/cmake.rb"
|
||||
FORMULA_EXPECTED_SHA256="c7ec95d86f0657638835441871e77541165e0a2581b53b3dd657cf13ad4228d4"
|
||||
|
||||
|
||||
mkdir -p /tmp/homebrew-formula
|
||||
curl -s -L $FORMULA_URL -o /tmp/homebrew-formula/cmake.rb
|
||||
|
||||
|
||||
# Verify the downloaded formula
|
||||
ACTUAL_SHA256=$(shasum -a 256 /tmp/homebrew-formula/cmake.rb | cut -d ' ' -f 1)
|
||||
if [ "$ACTUAL_SHA256" != "$FORMULA_EXPECTED_SHA256" ]; then
|
||||
@@ -36,7 +36,7 @@ runs:
|
||||
echo "Actual: $ACTUAL_SHA256"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Install cmake from the specific formula with force flag
|
||||
brew install --force /tmp/homebrew-formula/cmake.rb
|
||||
|
||||
@@ -70,5 +70,3 @@ runs:
|
||||
run: |
|
||||
mkdir -p $CCACHE_DIR
|
||||
mkdir -p $CONAN_USER_HOME/.conan
|
||||
|
||||
|
||||
|
||||
2
.github/actions/save_cache/action.yml
vendored
2
.github/actions/save_cache/action.yml
vendored
@@ -55,5 +55,3 @@ runs:
|
||||
with:
|
||||
path: ${{ inputs.ccache_dir }}
|
||||
key: clio-ccache-${{ runner.os }}-${{ inputs.build_type }}${{ inputs.code_coverage == 'true' && '-code_coverage' || '' }}-${{ inputs.conan_profile }}-develop-${{ steps.git_common_ancestor.outputs.commit }}
|
||||
|
||||
|
||||
|
||||
2
.github/actions/setup_conan/action.yml
vendored
2
.github/actions/setup_conan/action.yml
vendored
@@ -48,5 +48,3 @@ runs:
|
||||
else
|
||||
echo "Conan-non-prod is available"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user