-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (110 loc) · 3.51 KB
/
PR.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: PR job
on:
workflow_dispatch:
push:
branches:
- main
- development
pull_request:
paths-ignore:
- "**.md"
- "*.png"
- docs
jobs:
pre-conditions:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18
- name: Cache Kotlin Multiplatform
uses: ./.github/actions/kmp_cache
- name: detekt
run: ./gradlew detekt --stacktrace
- name: GitHub Action for SwiftLint (Only files changed in the PR)
uses: norio-nomura/[email protected]
env:
WORKING_DIRECTORY: ./iosApp
build-android:
needs: pre-conditions
runs-on: ubuntu-24.04
outputs:
kover_report_available: ${{ steps.kover_report.outputs.kover_report_available }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18
- name: Cache Kotlin Multiplatform
uses: ./.github/actions/kmp_cache
- name: Build
run: ./gradlew build --stacktrace
- name: Kover XML Report
uses: ./.github/actions/kover_report
id: kover_report
with:
kover_report_path: ${{ github.workspace }}/composeApp/build/reports/kover/reportDebug.xml
artifacts_name: "android-test-report"
- name: Upload Kover Report
if: steps.kover_report.outputs.kover_report_available == 'true'
uses: actions/[email protected]
with:
name: ${{ steps.kover_report.outputs.artifacts_name }}
path: ${{ github.workspace }}/composeApp/build/reports/kover/reportDebug.xml
retention-days: 5
build-ios:
needs: pre-conditions
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Cache Kotlin Multiplatform
uses: ./.github/actions/kmp_cache
- name: Select Xcode version
run: |
XCODE_VERSION="15.0"
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app"
- name: Build
run: |
cd iosApp
rm -f iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
xcodebuild -resolvePackageDependencies -project iosApp.xcodeproj
xcodebuild build-for-testing \
-scheme "iosApp" \
-project iosApp.xcodeproj \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=18.0' \
-allowProvisioningUpdates \
-configuration Debug \
DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }}
comment-test-report:
needs: [build-android]
if: |
always() &&
github.event_name == 'pull_request' &&
needs.build-android.outputs.kover_report_available == 'true'
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Comment Kover Report to PR
uses: ./.github/actions/comment_kover_report_to_pr
with:
platform: Android
report_name: "android-test-report"