mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 03:45:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			94 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			94 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Run conan and cmake
 | 
						|
description: Run conan and cmake
 | 
						|
 | 
						|
inputs:
 | 
						|
  conan_profile:
 | 
						|
    description: Conan profile name
 | 
						|
    required: true
 | 
						|
  force_conan_source_build:
 | 
						|
    description: Whether conan should build all dependencies from source
 | 
						|
    required: true
 | 
						|
    default: "false"
 | 
						|
  build_type:
 | 
						|
    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"
 | 
						|
  build_benchmark:
 | 
						|
    description: Whether to build benchmark tests
 | 
						|
    required: true
 | 
						|
    default: "true"
 | 
						|
  code_coverage:
 | 
						|
    description: Whether conan's coverage option should be on or not
 | 
						|
    required: true
 | 
						|
    default: "false"
 | 
						|
  static:
 | 
						|
    description: Whether Clio is to be statically linked
 | 
						|
    required: true
 | 
						|
    default: "false"
 | 
						|
  time_trace:
 | 
						|
    description: Whether to enable compiler trace reports
 | 
						|
    required: true
 | 
						|
    default: "false"
 | 
						|
  use_mold:
 | 
						|
    description: Whether to use mold linker
 | 
						|
    required: true
 | 
						|
    default: "false"
 | 
						|
 | 
						|
runs:
 | 
						|
  using: composite
 | 
						|
  steps:
 | 
						|
    - name: Create build directory
 | 
						|
      shell: bash
 | 
						|
      run: mkdir -p build
 | 
						|
 | 
						|
    - name: Run conan
 | 
						|
      shell: bash
 | 
						|
      env:
 | 
						|
        CONAN_BUILD_OPTION: "${{ inputs.force_conan_source_build == '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' }}"
 | 
						|
        BENCHMARK_OPTION: "${{ inputs.build_benchmark == 'true' && 'True' || 'False' }}"
 | 
						|
        TIME_TRACE: "${{ inputs.time_trace == 'true' && 'True' || 'False' }}"
 | 
						|
        USE_MOLD: "${{ inputs.use_mold == 'true' && 'True' || 'False' }}"
 | 
						|
      run: |
 | 
						|
        cd build
 | 
						|
        conan \
 | 
						|
          install .. \
 | 
						|
          -of . \
 | 
						|
          -b "$CONAN_BUILD_OPTION" \
 | 
						|
          -s "build_type=${{ inputs.build_type }}" \
 | 
						|
          -o "&:static=${STATIC_OPTION}" \
 | 
						|
          -o "&:tests=True" \
 | 
						|
          -o "&:integration_tests=${INTEGRATION_TESTS_OPTION}" \
 | 
						|
          -o "&:benchmark=${BENCHMARK_OPTION}" \
 | 
						|
          -o "&:lint=False" \
 | 
						|
          -o "&:coverage=${CODE_COVERAGE}" \
 | 
						|
          -o "&:time_trace=${TIME_TRACE}" \
 | 
						|
          -o "&:use_mold=${USE_MOLD}" \
 | 
						|
          --profile:all "${{ inputs.conan_profile }}"
 | 
						|
 | 
						|
    - name: Run cmake
 | 
						|
      shell: bash
 | 
						|
      env:
 | 
						|
        BUILD_TYPE: "${{ inputs.build_type }}"
 | 
						|
        SANITIZER_OPTION: |-
 | 
						|
          ${{ endsWith(inputs.conan_profile, '.asan') && '-Dsan=address' ||
 | 
						|
              endsWith(inputs.conan_profile, '.tsan') && '-Dsan=thread' ||
 | 
						|
              endsWith(inputs.conan_profile, '.ubsan') && '-Dsan=undefined' ||
 | 
						|
              '' }}
 | 
						|
        USE_MOLD_OPTION: "${{ inputs.use_mold == 'true' && '-DUSE_MOLD=ON' || '' }}"
 | 
						|
      run: |
 | 
						|
        cd build
 | 
						|
        cmake \
 | 
						|
          -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
 | 
						|
          -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
 | 
						|
          "${USE_MOLD_OPTION}" \
 | 
						|
          "${SANITIZER_OPTION}" \
 | 
						|
          .. \
 | 
						|
          -G Ninja
 |