@@ -3,15 +3,24 @@ name: Android CI
33on :
44 push :
55 branches : [ main ]
6+
67 pull_request :
78 branches :
89 - ' **'
910
11+ workflow_dispatch :
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : true
16+
1017env :
1118 BUILD_CACHE_AWS_REGION : ${{ secrets.BUILD_CACHE_AWS_REGION }}
1219 BUILD_CACHE_AWS_BUCKET : ${{ secrets.BUILD_CACHE_AWS_BUCKET }}
1320 BUILD_CACHE_AWS_ACCESS_KEY_ID : ${{ secrets.BUILD_CACHE_AWS_ACCESS_KEY_ID }}
1421 BUILD_CACHE_AWS_SECRET_KEY : ${{ secrets.BUILD_CACHE_AWS_SECRET_KEY }}
22+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23+ GITHUB_PR_NUM : ${{ github.event.pull_request.number }}
1524
1625jobs :
1726 lint :
2029 steps :
2130 - name : Check out code
223123- - name : Set up JDK
24- 25- with :
26- distribution : adopt
27- java-version : 17
32+ - uses : ./.github/actions/setup-java
2833 - name : spotless
2934 run : ./gradlew spotlessCheck --scan
3035
3439 steps :
3540 - name : Check out code
364137- - name : Set up JDK
38- 39- with :
40- distribution : adopt
41- java-version : 17
42+ - uses : ./.github/actions/setup-java
4243 - name : API check
4344 run : ./gradlew apiCheck --scan
4445
4748 steps :
4849 - uses : actions/checkout@v3
4950
50- - name : set up JDK
51- 52- with :
53- distribution : adopt
54- java-version : 17
51+ - uses : ./.github/actions/setup-java
5552
56- - name : Cache Gradle and wrapper
57- uses : actions/cache@v3
58- with :
59- path : |
60- ~/.gradle/caches
61- ~/.gradle/wrapper
62- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
63- restore-keys : |
64- ${{ runner.os }}-gradle-
53+ - uses : ./.github/actions/gradle-cache
6554
6655 - name : Make Gradle executable
6756 run : chmod +x ./gradlew
@@ -79,26 +68,14 @@ jobs:
7968 - name : Checkout
8069 uses : actions/checkout@v3
8170
82- - name : set up JDK
83- 84- with :
85- distribution : adopt
86- java-version : 17
71+ - uses : ./.github/actions/setup-java
8772
88- - name : Cache Gradle and wrapper
89- uses : actions/cache@v3
90- with :
91- path : |
92- ~/.gradle/caches
93- ~/.gradle/wrapper
94- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
95- restore-keys : |
96- ${{ runner.os }}-gradle-
73+ - uses : ./.github/actions/gradle-cache
9774
9875 - name : Run unit tests
9976 run : |
100- ./gradlew :stream-video-android-ui-compose:testDebugUnitTest --scan --stacktrace
101- ./gradlew :stream-video-android-core:testDebugUnitTest --scan --stacktrace
77+ ./gradlew :stream-video-android-ui-compose:koverXmlReportDebug --scan --stacktrace
78+ ./gradlew :stream-video-android-core:koverXmlReportDebug --scan --stacktrace
10279
10380 - name : Unit tests core results
10481 uses : actions/upload-artifact@v4
@@ -112,21 +89,26 @@ jobs:
11289 name : unit-tests-compose-results
11390 path : stream-video-android-ui-compose/build/reports/tests/testDebugUnitTest/index.html
11491
92+ - uses : ./.github/actions/setup-ruby
93+
94+ - name : Sonar
95+ run : bundle exec fastlane run_sonar_analysis
96+ env :
97+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
98+
11599 androidTest-GMD :
116100 name : Android Test with GMD
117101 if : ${{ false }} # disable for now
118- runs-on : macOS -latest
102+ runs-on : ubuntu -latest
119103 timeout-minutes : 55
120104
121105 steps :
122106 - name : Checkout
123107 uses : actions/checkout@v3
124108
125- - name : Set up JDK 17
126- 127- with :
128- distribution : ' zulu'
129- java-version : 17
109+ - uses : ./.github/actions/setup-java
110+
111+ - uses : ./.github/actions/enable-kvm
130112
131113 # Sets gradle up
132114 - name : Setup Gradle
0 commit comments