-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (121 loc) · 3.82 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
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-22.04
outputs:
android: ${{ steps.needs.outputs.android }}
ios: ${{ steps.needs.outputs.ios }}
backend: ${{ steps.needs.outputs.backend }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Paths Changes Filter
uses: dorny/[email protected]
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'
- name: Output Needs
id: needs
run: |
echo "android=${{ steps.changes.outputs.android == 'true' }}" >> $GITHUB_OUTPUT
echo "ios=${{ steps.changes.outputs.ios == 'true' }}" >> $GITHUB_OUTPUT
echo "backend=${{ steps.changes.outputs.backend == 'true' }}" >> $GITHUB_OUTPUT
check-android:
runs-on: ubuntu-22.04
needs: changed
if: needs.changed.outputs.android == 'true'
steps:
- uses: actions/checkout@v4
with:
lfs: 'true'
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/[email protected]
- name: Unit Tests
run: ./gradlew testDebugUnitTest
- name: Build
run: ./gradlew :app:android:assembleDevDebug
check-ios:
runs-on: macos-13
needs: changed
if: needs.changed.outputs.ios == 'true'
strategy:
matrix:
destination: [ 'platform=iOS Simulator,OS=17.2,name=iPhone 15' ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
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-22.04
needs: changed
if: needs.changed.outputs.backend == 'true'
steps:
- uses: actions/checkout@v4
with:
lfs: 'true'
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Unit Tests
run: ./gradlew :app:backend:check
- name: Build
run: ./gradlew :app:backend:buildFatJar