Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests parallelly on CI #1787

Merged
merged 5 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/gradle-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 19
java-version: ${{ matrix.jdk }}
- uses: gradle/gradle-build-action@v2
- name: Build with release Kotlin version
run: ./gradlew clean build ktlint --no-daemon
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).

### Changed

* Revert to matrix build to speed up build, especially for the Windows related build ([#1786](https://github.com/pinterest/ktlint/pull/1787))

## [0.48.2] - 2023-01-21

### Additional clarification on API Changes in `0.48.0` and `0.48.1`
Expand Down
39 changes: 0 additions & 39 deletions build-logic/src/main/kotlin/ToolchainForTests.kt

This file was deleted.

13 changes: 8 additions & 5 deletions build-logic/src/main/kotlin/ktlint-kotlin-common.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}

// All modules, the CLI included, must have an explicit API
explicitApi()
}

addAdditionalJdkVersionTests()
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ allprojects {
} else {
logger.warn("Skipping tests for task '$name' as system property 'skipTests=$skipTests'")
}

val args = mutableSetOf<String>()
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
// https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
args += listOf(
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
)
}
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) {
// https://openjdk.org/jeps/411
args += "-Djava.security.manager=allow"
}
jvmArgs(args)
}
}

Expand Down