mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-06 18:57:26 +01:00
Workflow improvements (#3891)
* add caching steps to build_check workflow * add gradle.properites for github runner * refactor ci-gradle.properties * specify ndk versiion in build.gradle * remove ndk install and cache steps from build_check * moved runner files to separate folder * refactor build_check.yml
This commit is contained in:
parent
4cbe497770
commit
e8f5963a57
23
.github/runner-files/checksum.sh
vendored
Executable file
23
.github/runner-files/checksum.sh
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
RESULT_FILE=$1
|
||||
|
||||
if [ -f $RESULT_FILE ]; then
|
||||
rm $RESULT_FILE
|
||||
fi
|
||||
touch $RESULT_FILE
|
||||
|
||||
checksum_file() {
|
||||
echo $(openssl md5 $1 | awk '{print $2}')
|
||||
}
|
||||
|
||||
FILES=()
|
||||
while read -r -d ''; do
|
||||
FILES+=("$REPLY")
|
||||
done < <(find . -type f \( -name "build.gradle*" -o -name "Dependencies.kt" -o -name "gradle-wrapper.properties" \) -print0)
|
||||
|
||||
# Loop through files and append MD5 to result file
|
||||
for FILE in ${FILES[@]}; do
|
||||
echo $(checksum_file $FILE) >> $RESULT_FILE
|
||||
done
|
||||
# Now sort the file so that it is
|
||||
sort $RESULT_FILE -o $RESULT_FILE
|
6
.github/runner-files/ci-gradle.properties
vendored
Normal file
6
.github/runner-files/ci-gradle.properties
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
org.gradle.daemon=false
|
||||
org.gradle.jvmargs=-Xmx5120m
|
||||
org.gradle.workers.max=2
|
||||
|
||||
kotlin.incremental=false
|
||||
kotlin.compiler.execution.strategy=in-process
|
20
.github/workflows/build_check.yml
vendored
20
.github/workflows/build_check.yml
vendored
@ -16,8 +16,24 @@ jobs:
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Install NDK
|
||||
run: sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.0.6113669" &> /dev/null
|
||||
|
||||
- name: Copy CI gradle.properties
|
||||
run: |
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
- name: Generate Gradle cache key
|
||||
run: ./.github/runner-files/checksum.sh checksum.txt
|
||||
|
||||
- name: Cache Gradle dependencies
|
||||
uses: actions/cache@v2
|
||||
continue-on-error: true # continue if the cache restore/upload fails
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches/build-cache-*
|
||||
~/.gradle/caches/jars-*
|
||||
~/.gradle/caches/modules-*
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('checksum.txt') }}
|
||||
|
||||
- name: Build app
|
||||
run: ./gradlew assembleStandardDebug
|
||||
|
@ -34,6 +34,7 @@ ext {
|
||||
android {
|
||||
compileSdkVersion AndroidConfig.compileSdk
|
||||
buildToolsVersion AndroidConfig.buildTools
|
||||
ndkVersion AndroidConfig.ndk
|
||||
|
||||
defaultConfig {
|
||||
applicationId "eu.kanade.tachiyomi"
|
||||
|
@ -3,4 +3,5 @@ object AndroidConfig {
|
||||
const val minSdk = 21
|
||||
const val targetSdk = 29
|
||||
const val buildTools = "29.0.3"
|
||||
const val ndk = "21.3.6528147"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user