@@ -18,8 +18,7 @@ concurrency:
18
18
19
19
jobs :
20
20
build :
21
- # Necessary to run full tests to cover iOS too
22
- runs-on : macos-14
21
+ runs-on : ubuntu-latest
23
22
steps :
24
23
- name : Checkout
25
24
uses : actions/checkout@v4
32
31
distribution : ' zulu'
33
32
java-version : ' 21'
34
33
35
- - uses : ruby/setup-ruby@v1
36
- with :
37
- bundler-cache : true
38
- ruby-version : ' 3.2.2'
39
-
40
- - uses : maxim-lobanov/setup-xcode@v1
41
- with :
42
- xcode-version : ' 15.2'
43
-
44
34
- name : Setup Gradle cache
45
35
uses : gradle/gradle-build-action@v2
46
36
with :
53
43
./gradlew --continue --no-configuration-cache \
54
44
check \
55
45
:samples:star:apk:assembleDebug \
56
- :samples:counter:linkReleaseFrameworkIosX64 \
57
46
detektMain \
58
47
detektTest \
59
48
assembleAndroidTest
63
52
run : |
64
53
./gradlew :samples:star:jvmJar -Pcircuit.buildDesktop
65
54
66
- - run : brew install swiftlint
67
-
68
- - name : Run lint on iOS samples
69
- run : bundle exec fastlane ios lint
70
-
71
- - name : Build iOS samples
72
- run : bundle exec fastlane ios build
73
-
74
55
# Defer these until after the above run, no need to waste resources running them if there are other failures first
75
56
- name : Run instrumentation tests via emulator.wtf (main repo only)
76
57
if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
79
60
EW_API_TOKEN : ${{ secrets.EMULATOR_WTF_TOKEN }}
80
61
run : ./gradlew testReleaseWithEmulatorWtf
81
62
63
+ - name : Enable KVM group perms
64
+ run : |
65
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
66
+ sudo udevadm control --reload-rules
67
+ sudo udevadm trigger --name-match=kvm
68
+
82
69
# Forks cannot run emulator.wtf tests due to not being able to use repo secrets, so for them
83
70
# we run the tests via the android-emulator-runner action instead
84
71
- name : Run instrumentation tests via local emulator (from forks only)
92
79
disable-animations : true
93
80
disk-size : 6000M
94
81
heap-size : 600M
95
- script : ./gradlew ciConnectedCheck --daemon
82
+ script : |
83
+ # Disable benchmark tests as they do not work on emulators
84
+ ./gradlew ciConnectedCheck -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=none
96
85
97
86
- name : (Fail-only) Upload reports
98
87
if : failure()
@@ -102,9 +91,49 @@ jobs:
102
91
path : |
103
92
**/build/reports/**
104
93
105
- - name : Publish snapshot (main branch only)
106
- if : github.repository == 'slackhq/circuit' && github.ref == 'refs/heads/main'
107
- run : ./gradlew publish -PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }} --no-configuration-cache
94
+ build-ios :
95
+ runs-on : macos-14
96
+
97
+ steps :
98
+ - name : Checkout
99
+ uses : actions/checkout@v4
100
+ with :
101
+ lfs : ' true'
102
+
103
+ - name : Install JDK
104
+ uses : actions/setup-java@v4
105
+ with :
106
+ distribution : ' zulu'
107
+ java-version : ' 21'
108
+
109
+ - uses : ruby/setup-ruby@v1
110
+ with :
111
+ bundler-cache : true
112
+ ruby-version : ' 3.2.2'
113
+
114
+ - uses : maxim-lobanov/setup-xcode@v1
115
+ with :
116
+ xcode-version : ' 15.2'
117
+
118
+ - name : Setup Gradle cache
119
+ uses : gradle/gradle-build-action@v2
120
+ with :
121
+ gradle-home-cache-cleanup : true
122
+ cache-read-only : false
123
+
124
+ - run : brew install swiftlint
125
+
126
+ - name : Run lint on iOS samples
127
+ run : bundle exec fastlane ios lint
128
+
129
+ - name : Run iOS Simulator tests
130
+ id : gradle-ios-tests
131
+ run : |
132
+ ./gradlew --continue --no-configuration-cache \
133
+ iosSimulatorArm64Test
134
+
135
+ - name : Build iOS samples
136
+ run : bundle exec fastlane ios build
108
137
109
138
snapshots :
110
139
runs-on : ubuntu-latest
@@ -139,3 +168,27 @@ jobs:
139
168
path : |
140
169
**/build/reports/**
141
170
**/src/test/snapshots/**/*_compare.png
171
+
172
+ publish :
173
+ runs-on : ubuntu-latest
174
+ needs : [build, build-ios, snapshots]
175
+ if : github.repository == 'slackhq/circuit' && github.ref == 'refs/heads/main'
176
+
177
+ steps :
178
+ - name : Checkout
179
+ uses : actions/checkout@v4
180
+
181
+ - name : Install JDK
182
+ uses : actions/setup-java@v4
183
+ with :
184
+ distribution : ' zulu'
185
+ java-version : ' 21'
186
+
187
+ - name : Setup Gradle cache
188
+ uses : gradle/gradle-build-action@v2
189
+ with :
190
+ gradle-home-cache-cleanup : true
191
+ cache-read-only : false
192
+
193
+ - name : Publish snapshot (main branch only)
194
+ run : ./gradlew publish -PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }} --no-configuration-cache
0 commit comments