mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-20 01:18:29 +00:00
Use sccache for rust build
This commit is contained in:
parent
095d821240
commit
23ad611566
19
.github/ccache.sh
vendored
19
.github/ccache.sh
vendored
@ -1,19 +0,0 @@
|
|||||||
OS=$(uname)
|
|
||||||
CCACHE_VER=4.4
|
|
||||||
|
|
||||||
case $OS in
|
|
||||||
Darwin )
|
|
||||||
brew install ccache
|
|
||||||
ln -s $(which ccache) ./ccache
|
|
||||||
;;
|
|
||||||
Linux )
|
|
||||||
sudo apt-get install -y ccache
|
|
||||||
ln -s $(which ccache) ./ccache
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
curl -OL https://github.com/ccache/ccache/releases/download/v${CCACHE_VER}/ccache-${CCACHE_VER}-windows-64.zip
|
|
||||||
unzip -j ccache-*-windows-64.zip '*/ccache.exe'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
mkdir ./.ccache
|
|
||||||
./ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
|
|
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@ -24,8 +24,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
env:
|
env:
|
||||||
NDK_CCACHE: ${{ github.workspace }}/ccache
|
NDK_CCACHE: ccache
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
|
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
@ -45,7 +47,17 @@ jobs:
|
|||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Set up ccache
|
- name: Set up ccache
|
||||||
run: bash .github/ccache.sh
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-${{ github.sha }}
|
||||||
|
restore-keys: ${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Set up sccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
variant: sccache
|
||||||
|
key: ${{ runner.os }}-${{ github.sha }}
|
||||||
|
restore-keys: ${{ runner.os }}
|
||||||
|
|
||||||
- name: Cache Gradle dependencies
|
- name: Cache Gradle dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@ -61,7 +73,6 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ github.workspace }}/.ccache
|
|
||||||
~/.gradle/caches/build-cache-*
|
~/.gradle/caches/build-cache-*
|
||||||
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
||||||
restore-keys: ${{ runner.os }}-build-cache-
|
restore-keys: ${{ runner.os }}-build-cache-
|
||||||
@ -71,13 +82,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: |
|
run: |
|
||||||
./ccache -zp
|
|
||||||
python build.py -vr all
|
python build.py -vr all
|
||||||
|
|
||||||
- name: Build debug
|
- name: Build debug
|
||||||
run: |
|
run: |
|
||||||
python build.py -v all
|
python build.py -v all
|
||||||
./ccache -s
|
|
||||||
|
|
||||||
- name: Stop gradle daemon
|
- name: Stop gradle daemon
|
||||||
run: ./gradlew --stop
|
run: ./gradlew --stop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user