File tree Expand file tree Collapse file tree 2 files changed +35
-20
lines changed Expand file tree Collapse file tree 2 files changed +35
-20
lines changed Original file line number Diff line number Diff line change 11# This workflow will build a Java project with Gradle
22
3- name : Build
3+ name : Build and unit test
44
5- on : [push]
5+ on : [ push ]
66
77jobs :
88 build :
1313 with :
1414 java-version : ' 21'
1515 distribution : ' adopt'
16+ - name : Cache Gradle packages
17+ uses : actions/cache@v4
18+ with :
19+ path : ~/.gradle/caches
20+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
21+ restore-keys : ${{ runner.os }}-gradle
1622 - name : Grant execute permission for gradlew
1723 run : chmod +x gradlew
1824 - name : Assemble
2430 path : |
2531 demos/**/build/outputs/apk/debug/*.apk
2632
33+ unit-tests :
34+ needs : build
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : actions/checkout@v4
38+ - uses : actions/setup-java@v4
39+ with :
40+ java-version : ' 21'
41+ distribution : ' adopt'
42+ - name : Cache Gradle packages
43+ uses : actions/cache@v4
44+ with :
45+ path : ~/.gradle/caches
46+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
47+ restore-keys : ${{ runner.os }}-gradle
48+ - name : Make gradlew executable
49+ working-directory : .
50+ run : chmod +x ./gradlew
51+ - name : Run unit tests
52+ working-directory : .
53+ run : ./gradlew test
54+ - name : Upload test reports
55+ if : ${{ !cancelled() }}
56+ uses : actions/upload-artifact@v4
57+ with :
58+ name : test-reports
59+ path : ' **/build/reports/tests'
Original file line number Diff line number Diff line change @@ -6,24 +6,6 @@ name: Run tests
66on : [ push ]
77
88jobs :
9- unit-tests :
10- runs-on : ubuntu-latest
11- steps :
12- - uses : actions/checkout@v4
13- - uses : actions/setup-java@v4
14- with :
15- java-version : ' 21'
16- distribution : ' adopt'
17- - name : Make gradlew executable
18- run : chmod +x ./gradlew
19- - name : Run unit test
20- run : ./gradlew test
21- - name : Upload test reports
22- if : ${{ !cancelled() }}
23- uses : actions/upload-artifact@v4
24- with :
25- name : test-reports-${{ matrix.api-level }}
26- path : ' **/build/reports/tests'
279 instrumented-tests :
2810 runs-on : ubuntu-latest
2911 timeout-minutes : 55
You can’t perform that action at this time.
0 commit comments