[CI] Use ccache to cache github action building

* Try ccache

* Cache Cmake

* No ccache in gradle cache

Co-authored-by: vvb2060 <vvb2060@gmail.com>
This commit is contained in:
LoveSy 2021-03-12 02:07:35 +08:00 committed by GitHub
parent 4fa8839bae
commit 7eda1f6845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -47,6 +47,14 @@ jobs:
gradle-manager-${{ hashFiles('**/*.gradle.kts') }} gradle-manager-${{ hashFiles('**/*.gradle.kts') }}
gradle-core gradle-core
gradle- gradle-
- name: Cache Cmake
uses: actions/cache@v2
with:
path: ~/.ccache
key: ccache-${{ hashFiles('core/src/main/cpp') }}
restore-keys: ccache-
- name: Install ccache
run: sudo apt-get install -y ccache
- name: Build with Gradle - name: Build with Gradle
run: | run: |
echo 'org.gradle.caching=true' >> gradle.properties echo 'org.gradle.caching=true' >> gradle.properties

View File

@ -95,6 +95,7 @@ android {
arguments("-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion", arguments("-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion",
"-DRIRU_MODULE_VERSION=$verCode", "-DRIRU_MODULE_VERSION=$verCode",
"-DRIRU_MODULE_VERSION_NAME:STRING=\"$verName\"") "-DRIRU_MODULE_VERSION_NAME:STRING=\"$verName\"")
targets("lspd")
} }
} }

View File

@ -20,6 +20,15 @@
cmake_minimum_required(VERSION 3.4.1) cmake_minimum_required(VERSION 3.4.1)
find_program( CCACHE ccache )
if ( CCACHE )
set( CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} )
set( CMAKE_C_COMPILER_LAUNCHER ${CCACHE} )
else()
message( WARNING "Could not find CCache program." )
endif()
link_libraries("-ffixed-x18") link_libraries("-ffixed-x18")
add_definitions(-DRIRU_MODULE) add_definitions(-DRIRU_MODULE)