Skip to content

Commit

Permalink
Backport Gradle Configuration Cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKriz committed Apr 15, 2024
1 parent a9a3160 commit ca6fedb
Show file tree
Hide file tree
Showing 156 changed files with 2,951 additions and 504 deletions.
81 changes: 57 additions & 24 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ on:
configuration:
type: choice
options:
- release
- debug
- release
required: true
default: release
default: debug
description:
'The configuration to use for the tests. "release" will produce release builds, "debug" will produce debug builds (and skip type mapping tests for now).'
'The configuration to use for the tests. "release" will produce release builds, "debug" will produce debug builds (type mapping tests currently always use release).'
target:
type: choice
options:
Expand All @@ -50,6 +50,7 @@ concurrency:
jobs:
acceptance-tests:
name: Acceptance Tests
needs: [gradle-tests]
runs-on: self-hosted
steps:
- name: Checkout Repo
Expand All @@ -67,18 +68,18 @@ jobs:
env:
KOTLIN_LINK_MODE: ${{ inputs.linkage }}
KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: ${{ failure() || success() }}
with:
check_name: "Smoke Test Reports - Functional Tests"
report_paths: 'SKIE/acceptance-tests/build/test-results/functional__*/TEST-*.xml'
require_tests: true
# Log size can be too large which causes significant performance issues
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: ${{ failure() || success() }}
# with:
# check_name: "Smoke Test Reports - Functional Tests"
# report_paths: 'SKIE/acceptance-tests/build/test-results/functional__*/TEST-*.xml'
# require_tests: true

type-mapping-tests:
name: Type Mapping Tests
needs: [acceptance-tests]
runs-on: self-hosted
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -90,25 +91,25 @@ jobs:
- name: Run Type Mapping Tests
uses: gradle/[email protected]
id: run-tests
if: ${{ inputs.configuration != 'debug' }}
with:
arguments: ':acceptance-tests:type-mapping__kgp_latestTest'
build-root-directory: SKIE
env:
KOTLIN_LINK_MODE: ${{ inputs.linkage }}
KOTLIN_TARGET: ${{ inputs.target }}
KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: ${{ (failure() || success()) && steps.run-tests.outcome != 'skipped' }}
with:
check_name: "Smoke Test Reports - Type Mapping Tests"
report_paths: 'SKIE/acceptance-tests/build/test-results/type-mapping__*/TEST-*.xml'
require_tests: true
# Log size can be too large which causes significant performance issues
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: ${{ (failure() || success()) && steps.run-tests.outcome != 'skipped' }}
# with:
# check_name: "Smoke Test Reports - Type Mapping Tests"
# report_paths: 'SKIE/acceptance-tests/build/test-results/type-mapping__*/TEST-*.xml'
# require_tests: true

external-libraries-tests:
name: External Libraries Tests
needs: [type-mapping-tests]
needs: [acceptance-tests, gradle-tests]
runs-on: self-hosted
steps:
- name: Checkout Repo
Expand All @@ -126,10 +127,42 @@ jobs:
env:
KOTLIN_LINK_MODE: ${{ inputs.linkage }}
KOTLIN_BUILD_CONFIGURATION: ${{ inputs.configuration }}
# Log size can be too large which causes significant performance issues
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: ${{ failure() || success() }}
# with:
# check_name: "Smoke Test Reports - External Libraries Tests"
# report_paths: 'SKIE/acceptance-tests/build/test-results/libraries__*/TEST-*.xml'
# require_tests: true

gradle-tests:
name: Gradle Tests
runs-on: self-hosted
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.ACCEPTANCE_TESTS_TOKEN }}
- name: Prepare Worker
uses: ./.github/actions/prepare-worker
- name: Run Gradle Tests
uses: gradle/[email protected]
id: run-tests
with:
arguments: >-
:test
-PtestLevel=smoke
-PtestType=gradle
"-Pmatrix.targets=${{ inputs.target || 'macosArm64' }}"
"-Pmatrix.configurations=${{ inputs.configuration || 'debug' }}"
"-Pmatrix.linkModes=${{ inputs.linkage || 'static' }}"
build-root-directory: test-runner
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
if: ${{ failure() || success() }}
with:
check_name: "Smoke Test Reports - External Libraries Tests"
report_paths: 'SKIE/acceptance-tests/build/test-results/libraries__*/TEST-*.xml'
check_name: "Smoke Test Reports - Gradle Tests"
report_paths: 'test-runner/build/test-results/test/TEST-*.xml'
require_tests: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="acceptanceTest" value="tests/coroutines/suspend/type_params_copied" />
<entry key="acceptanceTest" value="tests/coroutines/suspend/objects" />
</map>
</option>
<option name="executionName" />
Expand All @@ -26,4 +26,4 @@
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
</component>
4 changes: 2 additions & 2 deletions SKIE/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ buildSetup {

val gradle by group("skie-gradle") {
val plugin by module
val `plugin-api` by module
val `plugin-loader` by module
val `plugin-shim-api` by module
val `plugin-shim-impl` by module
}

val `acceptance-tests` by module {
Expand Down
110 changes: 0 additions & 110 deletions SKIE/skie-gradle/plugin-loader/gradle-plugin-loader.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
}

skiePublishing {
name = "SKIE Gradle Plugin API"
description = "API that's implemented by the SKIE Gradle Plugin, used by the loader module."
name = "SKIE Gradle Plugin Shim API"
description = "API that's implemented by the SKIE Gradle Plugin Shim Impl, used by the main plugin module to interact with Kotlin Gradle Plugin."
}

kotlin {
Expand All @@ -14,6 +14,9 @@ kotlin {
dependencies {
api(projects.common.configuration.configurationDeclaration)
implementation(projects.common.configuration.configurationApi)

compileOnly(libs.plugin.kotlin.gradle)
compileOnly(libs.plugin.kotlin.gradle.api)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.touchlab.skie.plugin.shim

import org.jetbrains.kotlin.konan.target.Distribution

interface DistributionProvider {

fun provideDistribution(
konanHome: String,
propertyOverrides: Map<String, String>?
): Distribution
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package co.touchlab.skie.plugin.shim

import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.utils.NativeCompilerDownloader

interface NativeCompilerDownloaderProvider {
fun provide(project: Project): NativeCompilerDownloader
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package co.touchlab.skie.plugin.shim

interface ShimEntrypoint {
val distributionProvider: DistributionProvider

val nativeCompilerDownloaderProvider: NativeCompilerDownloaderProvider
}
Loading

0 comments on commit ca6fedb

Please sign in to comment.