File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 55 branches :
66 - main
77 pull_request :
8+
89concurrency :
910 group : build-${{ github.ref }}
1011 cancel-in-progress : true
3031 distribution : ' zulu'
3132 java-version : 11
3233
34+ - name : chmod cache key
35+ run : chmod +x ./scripts/checksum.sh
36+
37+ - name : Generate cache key
38+ run : ./scripts/checksum.sh app checksum.txt
39+
40+ - uses : actions/cache@v3
41+ with :
42+ path : |
43+ ~/.gradle/caches/modules-*
44+ ~/.gradle/caches/jars-*
45+ ~/.gradle/caches/build-cache-*
46+ key : gradle-${{ hashFiles('checksum.txt') }}
47+
3348 - name : Setup Gradle
3449 uses : gradle/gradle-build-action@v2
3550
Original file line number Diff line number Diff line change 1+ # Cache check
2+
3+ #! /bin/bash
4+ SAMPLE=$1
5+ RESULT_FILE=$2
6+
7+ if [ -f $RESULT_FILE ]; then
8+ rm $RESULT_FILE
9+ fi
10+ touch $RESULT_FILE
11+
12+ checksum_file () {
13+ echo $( openssl md5 $1 | awk ' {print $2}' )
14+ }
15+
16+ FILES=()
17+ while read -r -d ' ' ; do
18+ FILES+=(" $REPLY " )
19+ done < <( find $SAMPLE -type f \( -name " build.gradle*" -o -name " gradle-wrapper.properties" -o -name " robolectric.properties" \) -print0)
20+
21+ # Loop through files and append MD5 to result file
22+ for FILE in ${FILES[@]} ; do
23+ echo $( checksum_file $FILE ) >> $RESULT_FILE
24+ done
25+ # Now sort the file so that it is idempotent
26+ sort $RESULT_FILE -o $RESULT_FILE
You can’t perform that action at this time.
0 commit comments