@@ -14,7 +14,7 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- build :
17+ build-and-check :
1818 runs-on : ubuntu-latest
1919 steps :
2020 - uses : actions/checkout@v4
@@ -27,10 +27,17 @@ jobs:
2727 uses : gradle/actions/setup-gradle@v4
2828 with :
2929 validate-wrappers : true
30- - name : Build
30+ gradle-home-cache-cleanup : true
31+ - name : Build Android
3132 run : ./gradlew assembleDebug :wearApp:assembleDebug
33+ - name : Build Desktop
34+ run : ./gradlew :desktopApp:jvmJar
3235 - name : Run tests
33- run : ./gradlew allTests
36+ run : ./gradlew jvmTest
37+ - name : Run Android Lint
38+ run : ./gradlew :androidApp:lintDebug :wearApp:lintDebug
39+ - name : Run Detekt
40+ run : ./gradlew detekt
3441 - name : Upload debug APKs
3542 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
3643 uses : actions/upload-artifact@v4
4047 androidApp/build/outputs/apk/debug/*.apk
4148 wearApp/build/outputs/apk/debug/*.apk
4249 retention-days : 14
43-
44- lint :
45- runs-on : ubuntu-latest
46- steps :
47- - uses : actions/checkout@v4
48- - name : Set up JDK 21
49- uses : actions/setup-java@v4
50- with :
51- distribution : ' temurin'
52- java-version : ' 21'
53- - name : Setup Gradle
54- uses : gradle/actions/setup-gradle@v4
55- with :
56- validate-wrappers : true
57- - name : Run Android Lint
58- run : ./gradlew :androidApp:lintDebug :wearApp:lintDebug
5950 - name : Upload lint reports
6051 if : always()
6152 uses : actions/upload-artifact@v4
@@ -64,24 +55,52 @@ jobs:
6455 path : |
6556 androidApp/build/reports/lint-results-debug.html
6657 wearApp/build/reports/lint-results-debug.html
58+ - name : Upload SARIF to GitHub
59+ if : always()
60+ uses : github/codeql-action/upload-sarif@v3
61+ with :
62+ sarif_file : build/reports/detekt/detekt.sarif
6763
68- detekt :
69- runs-on : ubuntu-latest
64+ ios-check :
65+ runs-on : macos-latest
66+ if : github.event_name == 'push' || github.event_name == 'pull_request'
7067 steps :
7168 - uses : actions/checkout@v4
69+ with :
70+ fetch-depth : 2
71+ - name : Check for iOS-related changes
72+ id : filter
73+ run : |
74+ if [ "${{ github.event_name }}" = "push" ]; then
75+ CHANGED=$(git diff --name-only HEAD~1 HEAD)
76+ else
77+ git fetch origin ${{ github.base_ref }} --depth=1
78+ CHANGED=$(git diff --name-only FETCH_HEAD HEAD)
79+ fi
80+ if echo "$CHANGED" | grep -qE '^(shared/|iosApp/|gradle/|build-logic/|.*\.gradle\.kts$|gradle\.properties$)'; then
81+ echo "should_run=true" >> "$GITHUB_OUTPUT"
82+ else
83+ echo "should_run=false" >> "$GITHUB_OUTPUT"
84+ fi
7285 - name : Set up JDK 21
86+ if : steps.filter.outputs.should_run == 'true'
7387 uses : actions/setup-java@v4
7488 with :
7589 distribution : ' temurin'
7690 java-version : ' 21'
7791 - name : Setup Gradle
92+ if : steps.filter.outputs.should_run == 'true'
7893 uses : gradle/actions/setup-gradle@v4
7994 with :
8095 validate-wrappers : true
81- - name : Run Detekt
82- run : ./gradlew detekt
83- - name : Upload SARIF to GitHub
84- if : always()
85- uses : github/codeql-action/upload-sarif@v3
96+ gradle-home-cache-cleanup : true
97+ - name : Cache Kotlin/Native compiler
98+ if : steps.filter.outputs.should_run == 'true'
99+ uses : actions/cache@v4
86100 with :
87- sarif_file : build/reports/detekt/detekt.sarif
101+ path : ~/.konan
102+ key : konan-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }}
103+ restore-keys : konan-${{ runner.os }}-
104+ - name : Build iOS framework
105+ if : steps.filter.outputs.should_run == 'true'
106+ run : ./gradlew :shared:linkReleaseFrameworkIosSimulatorArm64
0 commit comments