File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 8282
8383 - name : Load LLVM sccache
8484 id : cached-sccache
85- if : steps.cached-llvm.outputs.cache-hit != 'true'
85+ # Always save the (potentially partial) sccache database so it can be used to accelerate subsequent builds when an intermittent failure occurs
86+ if : steps.cached-llvm.outputs.cache-hit != 'true' && always()
8687 uses : actions/cache@v2
8788 # If you change this configuration make sure to update keep-cache-warm.yml as well.
8889 with :
@@ -105,8 +106,17 @@ jobs:
105106 run : ${{matrix.build-command}}
106107
107108 - name : Show sccache statistics
108- if : steps.cached-llvm.outputs.cache-hit != 'true'
109- run : sccache --show-stats
109+ if : steps.cached-llvm.outputs.cache-hit != 'true' && always()
110+ run : sccache --show-stats 2>&1 | tee ${{steps.sccache.outputs.root-directory}}/sccache-stats.txt
111+
112+ - name : Save sccache logs
113+ uses : actions/upload-artifact@v2
114+ if : steps.cached-llvm.outputs.cache-hit != 'true' && always()
115+ with :
116+ name : llvm-${{matrix.rid}}-sccache-logs
117+ path : |
118+ ${{steps.sccache.outputs.log-file-path}}
119+ ${{steps.sccache.outputs.root-directory}}/sccache-stats.txt
110120
111121 # The GitHub Actions cache gets confused by the symlink so we need to remove it
112122 - name : Unsymlink libclang
Original file line number Diff line number Diff line change 4646# The binary is placed in a subdirectory of its download hash to ensure we don't re-use an old version.
4747sccache_root = os .path .join (os .getcwd (), "build-sccache" )
4848sccache_cache_directory = os .path .join (sccache_root , "cache" )
49+ sccache_cache_log_file_path = os .path .join (sccache_root , "sccache.log" )
4950
5051sccache_directory = os .path .join (sccache_root , expected_hash )
5152sccache_binary_location = os .path .join (sccache_directory , binary_name )
5253os .makedirs (sccache_directory , exist_ok = True )
5354
5455# Add sccache to the workspace path and configure sccache's cache directory
5556gha .set_output ('root-directory' , sccache_root )
57+ gha .set_output ('log-file-path' , sccache_cache_log_file_path )
5658gha .set_environment_variable ('SCCACHE_DIR' , sccache_cache_directory )
59+ gha .set_environment_variable ('SCCACHE_ERROR_LOG' , sccache_cache_log_file_path )
60+ gha .set_environment_variable ('SCCACHE_LOG' , 'info' )
5761gha .add_path (sccache_directory )
5862
5963# If the output path already exists, no need to download
You can’t perform that action at this time.
0 commit comments