GitHub Actions: Add ability to clear ccache

By specifying "ccache: clear" or "ccache: clean" in the commit message,
the workflow will issue a ccache --clear command before building.

Change-Id: I9e45ebcd8dc4b05cef9d6d7ea70bef67602d1223
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2020-09-27 16:09:23 +02:00
parent 63dc880b9f
commit 1e8f19e274

View File

@@ -363,6 +363,14 @@ jobs:
set(ENV{CCACHE_MAXSIZE} "1200M") set(ENV{CCACHE_MAXSIZE} "1200M")
endif() endif()
execute_process(
COMMAND git log --format=%B -n 1 ${{ github.event.after }}
OUTPUT_VARIABLE git_commit_msg
)
if (${git_commit_msg} MATCHES "ccache:[ ]*clea[r|n]")
execute_process(COMMAND ccache --clear COMMAND_ECHO STDOUT)
endif()
execute_process(COMMAND ccache -p) execute_process(COMMAND ccache -p)
execute_process(COMMAND ccache -z) execute_process(COMMAND ccache -z)