Skip to content

Commit

Permalink
Verify only a single IDE version per GHA job
Browse files Browse the repository at this point in the history
  • Loading branch information
rickclephas committed Jul 31, 2024
1 parent 14b981b commit 68419dd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/run-idea-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
strategy:
fail-fast: false
matrix:
platformType: [ IC, IU, AI ]
name: ${{ format('IDEA ({0})', matrix.platformType) }}
ide: [ IC, IU, AI ]
build: [ 241, 242 ]
name: ${{ format('IDEA ({0}-{1})', matrix.ide, matrix.build) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -57,5 +58,5 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Verify plugin
env:
VERIFICATION_PLATFORM_TYPE: ${{ matrix.platformType }}
run: ./gradlew :kmp-nativecoroutines-idea-plugin:verifyPlugin -PverificationPlatformType=$VERIFICATION_PLATFORM_TYPE
VERIFICATION_IDE: ${{ format('{0}-{1}', matrix.ide, matrix.build) }}
run: ./gradlew :kmp-nativecoroutines-idea-plugin:verifyPlugin -PverificationIde=$VERIFICATION_IDE
28 changes: 22 additions & 6 deletions kmp-nativecoroutines-idea-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask

plugins {
id("java")
Expand Down Expand Up @@ -76,16 +77,22 @@ intellijPlatform {

pluginVerification {
ides {
recommended()
select {
val platformType = findProperty("verificationPlatformType") as String?
types = when (platformType) {
null -> listOf(
val verificationIde = findProperty("verificationIde") as String?
if (verificationIde != null) {
val (platformType, build) = verificationIde.split('-', limit = 2)
select {
types = listOf(IntelliJPlatformType.fromCode(platformType))
sinceBuild = build
untilBuild = "$build.*"
}
} else {
recommended()
select {
types = listOf(
IntelliJPlatformType.IntellijIdeaCommunity,
IntelliJPlatformType.IntellijIdeaUltimate,
IntelliJPlatformType.AndroidStudio,
)
else -> listOf(IntelliJPlatformType.fromCode(platformType))
}
}
}
Expand All @@ -108,3 +115,12 @@ val runAndroidStudio by intellijPlatformTesting.runIde.registering {
tasks.withType(RunIdeTask::class) {
maxHeapSize = "4g"
}

tasks.withType(VerifyPluginTask::class) {
val verificationIde = findProperty("verificationIde") as String? ?: return@withType
onlyIf {
val hasIdes = ides.files.isNotEmpty()
if (!hasIdes) logger.warn("::warning title=Skipped unknown IDE::Unknown IDE $verificationIde")
hasIdes
}
}

0 comments on commit 68419dd

Please sign in to comment.