-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub workflows tests + test & compilation improvements (#49)
* bump Gradle 7.5.1 * create KxsTsGenBuildSettings, so TSCompile tests can be enabled/disabled with a flag * create github workflows * kotlin.mpp.stability.nowarn=true * bump kotlinx-kover * bump kotlin 1.7.21 * bump gradle-git-versioning-plugin * tweak gradle props * update property name kxstsgen_enableTsCompileTests * increase logging, disable fail-fast * binaries.executable() -> browser() * add rootProject.name to buildSrc Gradle settings * bump Kotlin language level to 1.7, standardise Jvm target to 11 * rm java-library from kotlin-mpp * setup java-test-fixtures, change 'example' to be in 'main' source set * only enable NPM setup when TSCompile is enabled * update kotlin-process * disable kotest plugin kotest/kotest#3141 * use embeddedKotlinVersion shortcut * improve ts compile testing * combine TS compile tests in matrix
- Loading branch information
Showing
18 changed files
with
193 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Gradle Task | ||
run-name: "Gradle Task ${{ inputs.gradle-task }} @ ${{ inputs.runs-on }}" | ||
|
||
# Reusable Workflow for running a Gradle task | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
workflow_call: | ||
inputs: | ||
gradle-task: | ||
description: "The Gradle task to run, including any flags" | ||
required: true | ||
type: string | ||
runs-on: | ||
description: "OSes to run the task on" | ||
required: true | ||
type: string | ||
|
||
|
||
concurrency: | ||
# note: the Workflow inputs are also included in the concurrency group | ||
group: "${{ github.workflow }} ${{ join(inputs.*) }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
|
||
jobs: | ||
|
||
run-task: | ||
runs-on: ${{ inputs.runs-on }} | ||
name: "./gradlew ${{ inputs.gradle-task}} @ ${{ inputs.runs-on }}" | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Run ${{ inputs.gradle-task }} | ||
run: >- | ||
./gradlew ${{ inputs.gradle-task }} | ||
- name: Upload build reports | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-report-${{ runner.os }}-${{ github.action }} | ||
path: "**/build/reports/" | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
|
||
jobs: | ||
|
||
gradle-check: | ||
name: "./gradlew ${{ matrix.target }} @ ${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-11, windows-latest ] | ||
tsCompileTests: [ true, false ] | ||
fail-fast: false | ||
uses: ./.github/workflows/gradle_task.yml | ||
with: | ||
runs-on: ${{ matrix.os }} | ||
gradle-task: >- | ||
check -Pkxstsgen_enableTsCompileTests=${{ matrix.tsCompileTests }} --info --stacktrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
buildSrc/src/main/kotlin/buildsrc/config/KxsTsGenBuildSettings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package buildsrc.config | ||
|
||
import org.gradle.api.provider.Provider | ||
import org.gradle.api.provider.ProviderFactory | ||
|
||
abstract class KxsTsGenBuildSettings( | ||
private val providers: ProviderFactory | ||
) { | ||
val enableTsCompileTests: Provider<Boolean> = | ||
providers | ||
.gradleProperty("kxstsgen_enableTsCompileTests") | ||
.map { it.toBoolean() } | ||
.orElse(false) | ||
|
||
companion object { | ||
const val NAME = "kxsTsGenSettings" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 24 additions & 6 deletions
30
buildSrc/src/main/kotlin/buildsrc/convention/kotlin-mpp.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2g | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
org.gradle.unsafe.configuration-cache=true | ||
org.gradle.unsafe.configuration-cache-problems=warn | ||
|
||
# https://github.com/gradle/gradle/issues/20416 | ||
# cache accessors - defaults to 'true' in Gradle 8.0 https://github.com/gradle/gradle/issues/20416 | ||
org.gradle.kotlin.dsl.precompiled.accessors.strict=true | ||
|
||
kotlin.mpp.stability.nowarn=true | ||
|
||
kxstsgen_enableTsCompileTests=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.