-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (158 loc) · 5.64 KB
/
checks.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: "Checks"
on:
pull_request:
branches:
- main
# Cancel any current or previous job from the same PR
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
changed:
runs-on: ubuntu-24.04
outputs:
android: ${{ steps.changes.outputs.android }}
ios: ${{ steps.changes.outputs.ios }}
backend: ${{ steps.changes.outputs.backend }}
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# https://github.com/marketplace/actions/paths-changes-filter
- name: Paths Changes Filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
android:
- 'app/android/**/*'
- 'app/shared/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'feature/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
ios:
- 'app/ios/**/*'
- 'app/ios-combined/**/*'
- 'app/shared/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'feature/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
backend:
- 'app/backend/**/*'
- 'build-logic/**/*'
- 'core/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
check-android:
runs-on: ubuntu-24.04
needs: changed
if: needs.changed.outputs.android == 'true'
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: 'true'
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Unit Tests
run: ./gradlew testDebugUnitTest
- name: Build
run: ./gradlew :app:android:assembleDevDebug
check-ios:
runs-on: macos-14
needs: changed
if: needs.changed.outputs.ios == 'true'
strategy:
matrix:
destination: [ 'platform=iOS Simulator,OS=17.2,name=iPhone 15' ]
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
# https://github.com/marketplace/actions/setup-xcode-version
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '15.1.0'
- name: Build iOS framework
run: ./gradlew :app:ios-combined:assembleNitoKmpReleaseXCFramework
- name: Run iOS unit tests
continue-on-error: true
run: xcodebuild clean build -project app/ios/App/Nito/Nito.xcodeproj -configuration Debug -scheme Dev -sdk iphoneos -destination "${destination}" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -test-timeouts-enabled YES
env:
destination: ${{ matrix.destination }}
check-backend:
runs-on: ubuntu-24.04
needs: changed
if: needs.changed.outputs.backend == 'true'
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: 'true'
- name: Copy CI gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle
cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup Java JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: 17
# https://github.com/marketplace/actions/build-with-gradle
- name: Build with Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Unit Tests
run: ./gradlew :app:backend:check
- name: Build
run: ./gradlew :app:backend:buildFatJar
status-check:
runs-on: ubuntu-24.04
needs:
- check-android
- check-ios
- check-backend
permissions: { }
if: failure()
steps:
- run: exit 1