Update workflow (#2197)

This commit is contained in:
LoveSy 2022-10-27 20:31:51 +08:00 committed by GitHub
parent 673114d81b
commit 7aff345756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 19 deletions

View File

@ -9,6 +9,11 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "1G"
CCACHE_HARDLINK: "true"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -28,7 +33,7 @@ jobs:
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'zulu' distribution: 'temurin'
java-version: '17' java-version: '17'
cache: 'gradle' cache: 'gradle'
- name: Cache Gradle Build - name: Cache Gradle Build
@ -40,24 +45,11 @@ jobs:
key: gradle-builds-core-${{ github.sha }} key: gradle-builds-core-${{ github.sha }}
restore-keys: | restore-keys: |
gradle-builds gradle-builds
- name: Cache native build - name: Set up ccache
uses: actions/cache@v3 uses: hendrikmuhs/ccache-action@v1.2
with: with:
path: | key: ${{ runner.os }}
~/.ccache restore-keys: ${{ runner.os }}
magisk-loader/build/.lto-cache
daemon/build/.lto-cache
dex2oat/build/.lto-cache
key: native-cache-${{ github.sha }}
restore-keys: native-cache-
- name: Install dep
run: |
sudo apt-get install -y ccache
ccache -o max_size=1G
ccache -o hash_dir=false
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
ccache -o hard_link=true
ccache -zp
- name: Build with Gradle - name: Build with Gradle
run: | run: |
[ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* || true [ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* || true
@ -69,7 +61,6 @@ jobs:
echo 'android.native.buildOutput=verbose' >> gradle.properties echo 'android.native.buildOutput=verbose' >> gradle.properties
echo 'buildCache { local { removeUnusedEntriesAfterDays = 1 } }' >> settings.gradle.kts echo 'buildCache { local { removeUnusedEntriesAfterDays = 1 } }' >> settings.gradle.kts
./gradlew zipAll ./gradlew zipAll
ccache -s
- name: Prepare artifact - name: Prepare artifact
if: success() if: success()
id: prepareArtifact id: prepareArtifact