Skip to content

Commit 3a93534

Browse files
authored
Merge branch 'main' into wenli/visualizer-uds
2 parents 66010f9 + f1c2dca commit 3a93534

File tree

32 files changed

+1089
-299
lines changed

32 files changed

+1089
-299
lines changed

.github/actions/gradle-task/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ runs:
3636
run: ./gradlew tasks
3737

3838
- name: Set up JDK
39-
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
39+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
4040
with:
4141
distribution: ${{inputs.distribution}}
4242
java-version: ${{inputs.java-version}}
@@ -46,7 +46,7 @@ runs:
4646
uses: ./.github/actions/gradle-args
4747

4848
- name: Gradle build action
49-
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
49+
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
5050
with:
5151
cache-read-only: false
5252
gradle-home-cache-cleanup: true
@@ -101,11 +101,11 @@ runs:
101101
${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}
102102
${{runner.os}}-${{inputs.restore-cache-key}}
103103
104-
- uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2
104+
- uses: gradle/actions/wrapper-validation@94baf225fe0a508e581a564467443d0e2379123b # v4
105105

106106
# Run the actual task. Note that this still uses gradle-build-action for more fine-grained caching.
107107
- name: Run ${{inputs.task}}
108-
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
108+
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
109109
with:
110110
# These arguments need to be on a single line. If they're defined with wrapping (using `|`),
111111
# something along the way to the actual CLI invocation gets confused and the jvmargs list
@@ -133,21 +133,21 @@ runs:
133133

134134
- name: Upload Any Logs
135135
if: failure()
136-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
136+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
137137
with:
138138
name: log-upload
139139
path: ${{github.workspace}}/**/*.log
140140

141141
- name: Upload Any Heap Dumps
142142
if: failure()
143-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
143+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
144144
with:
145145
name: hprof-upload
146146
path: ${{github.workspace}}/**/*.hprof
147147

148148
- name: Upload Any Specified Files
149149
if: failure() && inputs.failure-path-upload != 'null'
150-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
150+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
151151
with:
152152
name: specified-upload
153153
path: ${{github.workspace}}/${{inputs.failure-path-upload}}

.github/actions/gradle-tasks-with-emulator/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ runs:
105105

106106
- name: Upload Any Logs
107107
if: failure()
108-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
108+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
109109
with:
110110
name: log-upload
111111
path: ${{github.workspace}}/**/*.log
112112

113113
- name: Upload Any Heap Dumps
114114
if: failure()
115-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
115+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
116116
with:
117117
name: hprof-upload
118118
path: ${{github.workspace}}/**/*.hprof
119119

120120
- name: Upload Any Specified Files
121121
if: failure() && inputs.failure-path-upload != 'null'
122-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
122+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
123123
with:
124124
name: specified-upload
125125
path: ${{github.workspace}}/${{inputs.failure-path-upload}}

.github/workflows/kotlin.yml

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ jobs:
179179
write-cache-key: main-build-artifacts
180180

181181
check:
182-
name: Check
182+
name: Unit Tests
183183
runs-on: macos-latest
184184
needs: build-all
185-
timeout-minutes: 20
185+
timeout-minutes: 40
186186
steps:
187187
- name: Checkout
188188
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -199,7 +199,7 @@ jobs:
199199

200200
# Report as GitHub Pull Request Check.
201201
- name: Publish Test Report
202-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
202+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
203203
if: always() # always run even if the previous step fails
204204
with:
205205
report_paths: '**/build/test-results/test/TEST-*.xml'
@@ -236,10 +236,10 @@ jobs:
236236

237237
# Report as GitHub Pull Request Check.
238238
- name: Publish Test Report
239-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
239+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
240240
if: always() # always run even if the previous step fails
241241
with:
242-
report_paths: '**/build/test-results/test/TEST-*.xml'
242+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
243243

244244
jvm-conflate-runtime-test:
245245
name: CSR JVM Tests
@@ -257,10 +257,10 @@ jobs:
257257

258258
# Report as GitHub Pull Request Check.
259259
- name: Publish Test Report
260-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
260+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
261261
if: always() # always run even if the previous step fails
262262
with:
263-
report_paths: '**/build/test-results/test/TEST-*.xml'
263+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
264264

265265
jvm-stateChange-runtime-test:
266266
name: SCO JVM Tests
@@ -278,10 +278,10 @@ jobs:
278278

279279
# Report as GitHub Pull Request Check.
280280
- name: Publish Test Report
281-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
281+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
282282
if: always() # always run even if the previous step fails
283283
with:
284-
report_paths: '**/build/test-results/test/TEST-*.xml'
284+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
285285

286286
jvm-stable-handlers-test:
287287
name: SEH JVM Tests
@@ -299,10 +299,10 @@ jobs:
299299

300300
# Report as GitHub Pull Request Check.
301301
- name: Publish Test Report
302-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
302+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
303303
if: always() # always run even if the previous step fails
304304
with:
305-
report_paths: '**/build/test-results/test/TEST-*.xml'
305+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
306306

307307
jvm-partial-runtime-test:
308308
name: PTR JVM Tests
@@ -320,10 +320,10 @@ jobs:
320320

321321
# Report as GitHub Pull Request Check.
322322
- name: Publish Test Report
323-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
323+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
324324
if: always() # always run even if the previous step fails
325325
with:
326-
report_paths: '**/build/test-results/test/TEST-*.xml'
326+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
327327

328328
jvm-conflate-stateChange-runtime-test:
329329
name: SCO, CSR JVM Tests
@@ -341,10 +341,10 @@ jobs:
341341

342342
# Report as GitHub Pull Request Check.
343343
- name: Publish Test Report
344-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
344+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
345345
if: always() # always run even if the previous step fails
346346
with:
347-
report_paths: '**/build/test-results/test/TEST-*.xml'
347+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
348348

349349
jvm-conflate-partial-runtime-test:
350350
name: CSR, PTR JVM Tests
@@ -362,10 +362,10 @@ jobs:
362362

363363
# Report as GitHub Pull Request Check.
364364
- name: Publish Test Report
365-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
365+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
366366
if: always() # always run even if the previous step fails
367367
with:
368-
report_paths: '**/build/test-results/test/TEST-*.xml'
368+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
369369

370370
jvm-conflate-drainExclusive-runtime-test:
371371
name: CSR, DEA JVM Tests
@@ -383,10 +383,10 @@ jobs:
383383

384384
# Report as GitHub Pull Request Check.
385385
- name: Publish Test Report
386-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
386+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
387387
if: always() # always run even if the previous step fails
388388
with:
389-
report_paths: '**/build/test-results/test/TEST-*.xml'
389+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
390390

391391
jvm-stateChange-drainExclusive-runtime-test:
392392
name: SCO, DEA JVM Tests
@@ -404,10 +404,10 @@ jobs:
404404

405405
# Report as GitHub Pull Request Check.
406406
- name: Publish Test Report
407-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
407+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
408408
if: always() # always run even if the previous step fails
409409
with:
410-
report_paths: '**/build/test-results/test/TEST-*.xml'
410+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
411411

412412
jvm-partial-drainExclusive-runtime-test:
413413
name: PTR, DEA JVM Tests
@@ -425,10 +425,10 @@ jobs:
425425

426426
# Report as GitHub Pull Request Check.
427427
- name: Publish Test Report
428-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
428+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
429429
if: always() # always run even if the previous step fails
430430
with:
431-
report_paths: '**/build/test-results/test/TEST-*.xml'
431+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
432432

433433
jvm-conflate-stateChange-drainExclusive-runtime-test:
434434
name: SCO, CSR, DEA JVM Tests
@@ -446,10 +446,10 @@ jobs:
446446

447447
# Report as GitHub Pull Request Check.
448448
- name: Publish Test Report
449-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
449+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
450450
if: always() # always run even if the previous step fails
451451
with:
452-
report_paths: '**/build/test-results/test/TEST-*.xml'
452+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
453453

454454
jvm-conflate-partial-drainExclusive-runtime-test:
455455
name: CSR, PTR, DEA JVM Tests
@@ -467,10 +467,31 @@ jobs:
467467

468468
# Report as GitHub Pull Request Check.
469469
- name: Publish Test Report
470-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
470+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
471471
if: always() # always run even if the previous step fails
472472
with:
473-
report_paths: '**/build/test-results/test/TEST-*.xml'
473+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
474+
475+
jvm-all-runtime-test:
476+
name: ALL Optimizations JVM Tests
477+
runs-on: ubuntu-latest
478+
timeout-minutes: 20
479+
steps:
480+
- name: Checkout
481+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
482+
483+
- name: Check with Gradle
484+
uses: ./.github/actions/gradle-task
485+
with:
486+
task: jvmTest --continue -Pworkflow.runtime=all
487+
restore-cache-key: main-build-artifacts
488+
489+
# Report as GitHub Pull Request Check.
490+
- name: Publish Test Report
491+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
492+
if: always() # always run even if the previous step fails
493+
with:
494+
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'
474495

475496
ios-tests:
476497
name: iOS Tests
@@ -488,10 +509,10 @@ jobs:
488509

489510
# Report as GitHub Pull Request Check.
490511
- name: Publish Test Report
491-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
512+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
492513
if: always() # always run even if the previous step fails
493514
with:
494-
report_paths: '**/build/test-results/test/TEST-*.xml'
515+
report_paths: '**/build/test-results/iosX64Test/TEST-*.xml'
495516

496517
js-tests:
497518
name: JS Tests
@@ -510,10 +531,10 @@ jobs:
510531

511532
# Report as GitHub Pull Request Check.
512533
- name: Publish Test Report
513-
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5 # v4
534+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
514535
if: always() # always run even if the previous step fails
515536
with:
516-
report_paths: '**/build/test-results/test/TEST-*.xml'
537+
report_paths: '**/build/test-results/jsTest/TEST-*.xml'
517538

518539
performance-tests:
519540
name: Performance tests
@@ -578,7 +599,7 @@ jobs:
578599
### <start-connected-check-shards>
579600
shardNum: [ 1, 2, 3 ]
580601
### <end-connected-check-shards>
581-
runtime: [ conflate, stateChange, drainExclusive, conflate-stateChange, partial, conflate-partial, stable, conflate-drainExclusive, stateChange-drainExclusive, partial-drainExclusive, conflate-partial-drainExclusive ]
602+
runtime: [ conflate, stateChange, drainExclusive, conflate-stateChange, partial, conflate-partial, stable, conflate-drainExclusive, stateChange-drainExclusive, partial-drainExclusive, conflate-partial-drainExclusive, all ]
582603
steps:
583604
- name: Checkout
584605
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -618,6 +639,7 @@ jobs:
618639
- jvm-partial-drainExclusive-runtime-test
619640
- jvm-conflate-stateChange-drainExclusive-runtime-test
620641
- jvm-conflate-partial-drainExclusive-runtime-test
642+
- jvm-all-runtime-test
621643
- ktlint
622644
- performance-tests
623645
- runtime-instrumentation-tests

samples/compose-samples/src/main/java/com/squareup/sample/compose/hellocomposebinding/HelloBindingActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.os.Bundle
66
import androidx.activity.viewModels
77
import androidx.appcompat.app.AppCompatActivity
88
import androidx.compose.material.MaterialTheme
9+
import androidx.compose.ui.platform.AndroidUiDispatcher
910
import androidx.lifecycle.SavedStateHandle
1011
import androidx.lifecycle.ViewModel
1112
import androidx.lifecycle.viewModelScope
@@ -21,6 +22,7 @@ import com.squareup.workflow1.ui.plus
2122
import com.squareup.workflow1.ui.withEnvironment
2223
import com.squareup.workflow1.ui.workflowContentView
2324
import kotlinx.coroutines.flow.StateFlow
25+
import kotlinx.coroutines.plus
2426

2527
private val viewEnvironment =
2628
(ViewEnvironment.EMPTY + ViewRegistry(HelloBinding))
@@ -47,7 +49,7 @@ class HelloBindingActivity : AppCompatActivity() {
4749
val renderings: StateFlow<Screen> by lazy {
4850
renderWorkflowIn(
4951
workflow = HelloWorkflow.mapRendering { it.withEnvironment(viewEnvironment) },
50-
scope = viewModelScope,
52+
scope = viewModelScope + AndroidUiDispatcher.Main,
5153
savedStateHandle = savedState,
5254
runtimeConfig = AndroidRuntimeConfigTools.getAppWorkflowRuntimeConfig()
5355
)

samples/compose-samples/src/main/java/com/squareup/sample/compose/hellocomposeworkflow/HelloComposeWorkflowActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package com.squareup.sample.compose.hellocomposeworkflow
55
import android.os.Bundle
66
import androidx.activity.viewModels
77
import androidx.appcompat.app.AppCompatActivity
8+
import androidx.compose.ui.platform.AndroidUiDispatcher
89
import androidx.lifecycle.SavedStateHandle
910
import androidx.lifecycle.ViewModel
1011
import androidx.lifecycle.viewModelScope
@@ -18,6 +19,7 @@ import com.squareup.workflow1.ui.compose.withComposeInteropSupport
1819
import com.squareup.workflow1.ui.withEnvironment
1920
import com.squareup.workflow1.ui.workflowContentView
2021
import kotlinx.coroutines.flow.StateFlow
22+
import kotlinx.coroutines.plus
2123

2224
class HelloComposeWorkflowActivity : AppCompatActivity() {
2325
override fun onCreate(savedInstanceState: Bundle?) {
@@ -32,7 +34,7 @@ class HelloComposeWorkflowActivity : AppCompatActivity() {
3234
workflow = HelloWorkflow.mapRendering {
3335
it.withEnvironment(ViewEnvironment.EMPTY.withComposeInteropSupport())
3436
},
35-
scope = viewModelScope,
37+
scope = viewModelScope + AndroidUiDispatcher.Main,
3638
savedStateHandle = savedState,
3739
runtimeConfig = AndroidRuntimeConfigTools.getAppWorkflowRuntimeConfig()
3840
)

samples/compose-samples/src/main/java/com/squareup/sample/compose/inlinerendering/InlineRenderingActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package com.squareup.sample.compose.inlinerendering
55
import android.os.Bundle
66
import androidx.activity.viewModels
77
import androidx.appcompat.app.AppCompatActivity
8+
import androidx.compose.ui.platform.AndroidUiDispatcher
89
import androidx.lifecycle.SavedStateHandle
910
import androidx.lifecycle.ViewModel
1011
import androidx.lifecycle.viewModelScope
@@ -18,6 +19,7 @@ import com.squareup.workflow1.ui.compose.withComposeInteropSupport
1819
import com.squareup.workflow1.ui.withEnvironment
1920
import com.squareup.workflow1.ui.workflowContentView
2021
import kotlinx.coroutines.flow.StateFlow
22+
import kotlinx.coroutines.plus
2123

2224
/**
2325
* A workflow that returns an anonymous
@@ -37,7 +39,7 @@ class InlineRenderingActivity : AppCompatActivity() {
3739
workflow = InlineRenderingWorkflow.mapRendering {
3840
it.withEnvironment(ViewEnvironment.EMPTY.withComposeInteropSupport())
3941
},
40-
scope = viewModelScope,
42+
scope = viewModelScope + AndroidUiDispatcher.Main,
4143
savedStateHandle = savedState,
4244
runtimeConfig = AndroidRuntimeConfigTools.getAppWorkflowRuntimeConfig()
4345
)

0 commit comments

Comments
 (0)