mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 03:45:50 +00:00 
			
		
		
		
	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
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Save cache
 | 
						|
description: Save conan and ccache cache for develop branch
 | 
						|
inputs:
 | 
						|
  conan_dir:
 | 
						|
    description: Path to .conan directory
 | 
						|
    required: true
 | 
						|
  conan_profile:
 | 
						|
    description: Conan profile name
 | 
						|
    required: true
 | 
						|
  conan_hash:
 | 
						|
    description: Hash to use as a part of conan cache key
 | 
						|
    required: true
 | 
						|
  conan_cache_hit:
 | 
						|
    description: Whether conan cache has been downloaded
 | 
						|
    required: true
 | 
						|
  ccache_dir:
 | 
						|
    description: Path to .ccache directory
 | 
						|
    required: true
 | 
						|
  ccache_cache_hit:
 | 
						|
    description: Whether conan cache has been downloaded
 | 
						|
    required: true
 | 
						|
  ccache_cache_miss_rate:
 | 
						|
    description: How many cache misses happened
 | 
						|
  build_type:
 | 
						|
    description: Current build type (e.g. Release, Debug)
 | 
						|
    required: true
 | 
						|
    default: Release
 | 
						|
  code_coverage:
 | 
						|
    description: Whether code coverage is on
 | 
						|
    required: true
 | 
						|
    default: 'false'
 | 
						|
runs:
 | 
						|
  using: composite
 | 
						|
  steps:
 | 
						|
    - name: Find common commit
 | 
						|
      id: git_common_ancestor
 | 
						|
      uses: ./.github/actions/git_common_ancestor
 | 
						|
 | 
						|
    - name: Cleanup conan directory from extra data
 | 
						|
      if: ${{ inputs.conan_cache_hit != 'true' }}
 | 
						|
      shell: bash
 | 
						|
      run: |
 | 
						|
        conan remove "*" -s -b -f
 | 
						|
 | 
						|
    - name: Save conan cache
 | 
						|
      if: ${{ inputs.conan_cache_hit != 'true' }}
 | 
						|
      uses: actions/cache/save@v4
 | 
						|
      with:
 | 
						|
        path: ${{ inputs.conan_dir }}/data
 | 
						|
        key: clio-conan_data-${{ runner.os }}-${{ inputs.build_type }}-${{ inputs.conan_profile }}-develop-${{ inputs.conan_hash }}
 | 
						|
 | 
						|
    - name: Save ccache cache
 | 
						|
      if: ${{ inputs.ccache_cache_hit != 'true' || inputs.ccache_cache_miss_rate == '100.0' }}
 | 
						|
      uses: actions/cache/save@v4
 | 
						|
      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 }}
 |