Skip to content

Commit

Permalink
Merge pull request #1011 from square/sedwards/clean-up-actions
Browse files Browse the repository at this point in the history
Clean Up Actions and Remove JMH Benchmarks
  • Loading branch information
steve-the-edwards authored Jun 9, 2023
2 parents 6446099 + 52e0632 commit 42ef981
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 375 deletions.
91 changes: 11 additions & 80 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs :
name : Check with Gradle
with :
arguments : |
allTests test apiCheck checkVersionIsSnapshot lint lintKotlin jvmWorkflowNodeBenchmarkJar --continue
allTests test apiCheck checkVersionIsSnapshot lint lintKotlin --continue
cache-read-only : false

# Report as Github Pull Request Check.
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs :
report_paths : '**/build/test-results/test/TEST-*.xml'

jvm-conflate-stateChange-runtime-test :
name : Render On State Change Only Runtime JVM Tests
name : Render On State Change Only and Conflate Stale Runtime JVM Tests
runs-on : ubuntu-latest
timeout-minutes : 20
steps :
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs :
if : ${{ always() }}
uses : actions/upload-artifact@v3
with :
name : instrumentation-test-results-${{ matrix.api-level }}
name : renderpass-counting-results-${{ matrix.api-level }}
path : ./**/build/reports/androidTests/connected/**

instrumentation-tests :
Expand Down Expand Up @@ -436,7 +436,7 @@ jobs :
if : ${{ always() }}
uses : actions/upload-artifact@v3
with :
name : instrumentation-test-results-${{ matrix.api-level }}
name : conflate-instrumentation-test-results-${{ matrix.api-level }}
path : ./**/build/reports/androidTests/connected/**

stateChange-runtime-instrumentation-tests :
Expand Down Expand Up @@ -484,11 +484,11 @@ jobs :
if : ${{ always() }}
uses : actions/upload-artifact@v3
with :
name : instrumentation-test-results-${{ matrix.api-level }}
name : stateChange-instrumentation-test-results-${{ matrix.api-level }}
path : ./**/build/reports/androidTests/connected/**

conflate-stateChange-runtime-instrumentation-tests :
name : Render on State Change Only Instrumentation tests
name : Render on State Change Only and Conflate Stale Renderings Instrumentation tests
runs-on : macos-latest
timeout-minutes : 45
strategy :
Expand Down Expand Up @@ -532,97 +532,28 @@ jobs :
if : ${{ always() }}
uses : actions/upload-artifact@v3
with :
name : instrumentation-test-results-${{ matrix.api-level }}
name : conflate-stateChange-instrumentation-test-results-${{ matrix.api-level }}
path : ./**/build/reports/androidTests/connected/**

upload-to-mobiledev :
name : mobile.dev | Build & Upload
runs-on : ubuntu-latest
timeout-minutes : 20
steps :
- uses : actions/checkout@v3

- name : set up JDK 11
if : env.MOBILE_DEV_API_KEY != null
uses : actions/setup-java@v3
with :
distribution : 'zulu'
java-version : 11
env :
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}


## Build artifact for upload with cache
- uses : gradle/gradle-build-action@v2
name : Build Performance Poetry APK
if : env.MOBILE_DEV_API_KEY != null
with :
arguments : |
benchmarks:performance-poetry:complex-poetry:assembleRelease
cache-read-only : false
env :
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}

## Upload with POST
- name : Upload Poetry to mobile.dev
if : env.MOBILE_DEV_API_KEY != null
id : upload_apk
run : |
#!/usr/bin/env bash
set -e
set -x
RESPONSE_ID=$(curl -X POST \
-H 'Content-Type: multipart/form-data' \
-H "Authorization: Bearer $MOBILE_DEV_API_KEY" \
--data-binary "@$APP_FILE" \
https://api.mobile.dev/apk | jq -r .id)
echo "::set-output name=apk_id::$RESPONSE_ID"
env :
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}
APP_FILE : benchmarks/performance-poetry/complex-poetry/build/outputs/apk/release/complex-poetry-release.apk

## Start analysis
- name : Start analysis on mobile.dev
if : env.MOBILE_DEV_API_KEY != null
run : |
#!/usr/bin/env bash
set -e
set -x
GIT_HASH=$(git log --pretty=format:'%h' -n 1)
BENCHMARK_NAME="$GIT_HASH"
REPO_BASE_NAME=$(basename "$REPO_NAME")
if [[ ! -z "$PULL_REQUEST_ID" ]]; then
PR_DATA=", \"repoOwner\":\"$REPO_OWNER\", \"repoName\":\"$REPO_BASE_NAME\", \"pullRequestId\":\"$PULL_REQUEST_ID\""
fi
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOBILE_DEV_API_KEY" \
https://api.mobile.dev/analysis \
--data "{\"benchmarkName\": \"$BENCHMARK_NAME\", \"apkId\": \"$APP_ID\", \"branch\": \"$BRANCH_NAME\"$PR_DATA}"
env :
APP_ID : ${{ steps.upload_apk.outputs.apk_id }}
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}
REPO_OWNER : ${{ github.repository_owner }}
REPO_NAME : ${{ github.repository }}
BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
PULL_REQUEST_ID : ${{ github.event.pull_request.number }}

all-green :
if : always()
runs-on : ubuntu-latest
needs :
- artifacts-check
- check
- conflate-renderings-instrumentation-tests
- conflate-stateChange-runtime-instrumentation-tests
- dependency-guard
- dokka
- instrumentation-tests
- ios-tests
- js-tests
- jvm-conflate-runtime-test
- jvm-conflate-stateChange-runtime-test
- jvm-stateChange-runtime-test
- performance-tests
- stateChange-runtime-instrumentation-tests
- tutorials
- upload-to-mobiledev

steps :
- name : require that all other jobs have passed
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import java.net.URL
buildscript {
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.kotlinx.benchmark.gradle.plugin)
classpath(libs.dokka.gradle.plugin)
classpath(libs.kotlin.serialization.gradle.plugin)
classpath(libs.kotlinx.binaryCompatibility.gradle.plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ private fun Project.maybeEnableExplicitApi(compileTask: KotlinCompile) {
path.startsWith(":samples") -> return
path.startsWith(":benchmarks") -> return
compileTask.name.contains("test", ignoreCase = true) -> return
compileTask.name.contains("jmh", ignoreCase = true) -> return
else -> compileTask.kotlinOptions {
// TODO this should be moved to `kotlin { explicitApi() }` once that's working for android
// projects, see https://youtrack.jetbrains.com/issue/KT-37652.
Expand Down
5 changes: 0 additions & 5 deletions dependencies/classpath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ com.squareup.retrofit2:converter-moshi:2.9.0
com.squareup.retrofit2:retrofit:2.9.0
com.squareup:javapoet:1.10.0
com.squareup:javawriter:2.5.0
com.squareup:kotlinpoet:1.3.0
com.sun.activation:javax.activation:1.2.0
com.sun.istack:istack-commons-runtime:3.0.8
com.sun.xml.fastinfoset:FastInfoset:1.2.16
Expand Down Expand Up @@ -110,7 +109,6 @@ net.java.dev.jna:jna:5.6.0
net.sf.jopt-simple:jopt-simple:4.9
net.sf.kxml:kxml2:2.3.0
org.apache.commons:commons-compress:1.20
org.apache.commons:commons-math3:3.2
org.apache.httpcomponents:httpclient:4.5.13
org.apache.httpcomponents:httpcore:4.4.13
org.apache.httpcomponents:httpmime:4.5.6
Expand Down Expand Up @@ -153,10 +151,8 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
org.jetbrains.kotlin:kotlin-tooling-core:1.7.20
org.jetbrains.kotlin:kotlin-util-io:1.7.20
org.jetbrains.kotlin:kotlin-util-klib-metadata:1.6.0
org.jetbrains.kotlin:kotlin-util-klib:1.7.20
org.jetbrains.kotlinx:binary-compatibility-validator:0.11.1
org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.4.2
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3
Expand All @@ -167,7 +163,6 @@ org.jetbrains:markdown:0.3.1
org.json:json:20180813
org.jsoup:jsoup:1.15.3
org.jvnet.staxex:stax-ex:1.8.1
org.openjdk.jmh:jmh-core:1.21
org.ow2.asm:asm-analysis:9.2
org.ow2.asm:asm-commons:9.2
org.ow2.asm:asm-tree:9.2
Expand Down
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ google-material = "1.4.0"
groovy = "3.0.9"
jUnit = "4.13.2"
javaParser = "3.24.0"
jmh = "1.34"
kotest = "5.1.0"
kotlin = "1.7.20"

kotlinx-binary-compatibility = "0.11.1"
kotlinx-coroutines = "1.6.4"
kotlinx-serialization-json = "1.3.2"
kotlinx-benchmark = "0.4.2"
kotlinx-atomicfu = "0.17.2"

kotlinter = "3.12.0"
Expand Down Expand Up @@ -100,7 +98,6 @@ google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinter" }
kotlinx-apiBinaryCompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-binary-compatibility" }
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-publish" }

[libraries]
Expand Down Expand Up @@ -211,8 +208,6 @@ kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test-common = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-benchmark-gradle-plugin = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin", version.ref = "kotlinx-benchmark" }
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "kotlinx-atomicfu" }

ktlint-core = { module = "com.pinterest.ktlint:ktlint-core", version.ref = "ktlint" }
Expand Down
35 changes: 1 addition & 34 deletions workflow-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation

plugins {
`kotlin-multiplatform`
published
id("org.jetbrains.kotlinx.benchmark")
}

kotlin {
Expand All @@ -14,28 +11,7 @@ kotlin {
iosWithSimulatorArm64()
}
if (targets == "kmp" || targets == "jvm") {
jvm {
compilations {
val main by getting

create("workflowNode") {
val workflowNodeCompilation: KotlinJvmCompilation = this
kotlinOptions {
// Associating compilations allows us to access declarations with `internal` visibility.
// It's the new version of the "-Xfriend-paths=___" compiler argument.
// https://youtrack.jetbrains.com/issue/KTIJ-7662/IDE-support-internal-visibility-introduced-by-associated-compilations
workflowNodeCompilation.associateWith(main)
}
defaultSourceSet {
dependencies {
implementation(libs.kotlinx.benchmark.runtime)

implementation(main.compileDependencyFiles + main.output.classesDirs)
}
}
}
}
}
jvm {}
}
if (targets == "kmp" || targets == "js") {
js { browser() }
Expand All @@ -49,12 +25,3 @@ dependencies {
commonTestImplementation(libs.kotlinx.coroutines.test.common)
commonTestImplementation(libs.kotlin.test.jdk)
}

benchmark {
targets {
register("jvmWorkflowNode") {
this as JvmBenchmarkTarget
jmhVersion = libs.versions.jmh.get()
}
}
}
16 changes: 0 additions & 16 deletions workflow-runtime/dependencies/jvmWorkflowNodeRuntimeClasspath.txt

This file was deleted.

Loading

0 comments on commit 42ef981

Please sign in to comment.