Skip to content

Commit e6ed075

Browse files
committed
ci: add konan cache
1 parent d007ec3 commit e6ed075

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

.github/workflows/prerelease.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ jobs:
3030

3131
- uses: ZNotify/test-server-action@master
3232

33+
- name: Get Kotlin version
34+
uses: gradle/gradle-build-action@main
35+
with:
36+
arguments: kotlinVersion
37+
38+
- name: Cache KotlinNative
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.konan
42+
key: ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
43+
3344
- name: Build with Gradle
3445
uses: gradle/gradle-build-action@main
3546
with:

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ jobs:
3131

3232
- uses: ZNotify/test-server-action@master
3333

34+
- name: Get Kotlin version
35+
uses: gradle/gradle-build-action@main
36+
with:
37+
arguments: kotlinVersion
38+
39+
- name: Cache KotlinNative
40+
uses: actions/cache@v2
41+
with:
42+
path: ~/.konan
43+
key: ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
44+
3445
- name: Build with Gradle
3546
uses: gradle/gradle-build-action@main
3647
with:

.github/workflows/test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ jobs:
3030
java-version: '17'
3131
cache: 'gradle'
3232

33-
- name: Grant execute permission for gradlew
34-
run: chmod +x gradlew
33+
- name: Get Kotlin version
34+
uses: gradle/gradle-build-action@main
35+
with:
36+
arguments: kotlinVersion
37+
38+
- name: Cache KotlinNative
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.konan
42+
key: ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
3543

3644
- name: Run unit tests
3745
uses: gradle/gradle-build-action@main

build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@file:Suppress("UnstableApiUsage", "UNUSED_VARIABLE")
22

33
import com.codingfeline.buildkonfig.compiler.FieldSpec
4+
import org.jetbrains.kotlin.config.KotlinCompilerVersion
45

56
group = "dev.zxilly"
67

@@ -257,3 +258,10 @@ signing {
257258
sign(publishing.publications)
258259
}
259260

261+
tasks.register("kotlinVersion"){
262+
doLast {
263+
println("Kotlin version: ${KotlinCompilerVersion.VERSION}")
264+
buildDir.mkdir()
265+
buildDir.resolve("kotlinVersion.txt").writeText(KotlinCompilerVersion.VERSION)
266+
}
267+
}

0 commit comments

Comments
 (0)