@@ -23,42 +23,80 @@ permissions:
2323 contents : write
2424
2525jobs :
26+ generate :
27+ runs-on : ubuntu-latest
28+ name : Generate grammar files
29+ steps :
30+ - name : Checkout repository
31+ uses : actions/checkout@v4
32+ with :
33+ submodules : true
34+ - name : Set up Java
35+ uses : actions/setup-java@v4
36+ with :
37+ distribution : temurin
38+ java-version : 17
39+ cache : gradle
40+ cache-dependency-path : |
41+ gradle/libs.versions.toml
42+ gradle/wrapper/gradle-wrapper.properties
43+ - name : Cache Kotlin/Native prebuilt
44+ uses : actions/cache@v4
45+ with :
46+ path : ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
47+ key : konan-${{runner.os}}-prebuilt-1.9
48+ - name : Generate files
49+ run : ./gradlew --no-daemon generateGrammarFiles
50+ env :
51+ KONAN_DATA_DIR : ${{runner.tool_cache}}/konan
52+ - name : Upload artifact
53+ uses : actions/upload-artifact@v4
54+ with :
55+ name : generated-files
56+ path : languages/*/build/generated/**
57+ retention-days : 1
2658 test :
2759 runs-on : ${{matrix.os}}
2860 name : >-
2961 Test ${{matrix.platform}} platform
3062 ${{matrix.lib_platform && format('({0}-{1})', matrix.lib_platform, matrix.lib_arch)}}
63+ needs : [generate]
3164 strategy :
3265 fail-fast : false
3366 matrix :
3467 include :
3568 - os : ubuntu-latest
3669 platform : JVM
37- targets : jvmTest
70+ targets : :ktreesitter: jvmTest
3871 lib_platform : linux
3972 lib_arch : x64
4073 - os : windows-latest
4174 platform : JVM
42- targets : jvmTest
75+ targets : :ktreesitter: jvmTest
4376 lib_platform : windows
4477 lib_arch : x64
4578 - os : macos-latest
4679 platform : JVM
47- targets : jvmTest
80+ targets : :ktreesitter: jvmTest
4881 lib_platform : macos
4982 lib_arch : aarch64
50- # - os: ubuntu-latest
51- # platform: Android
52- # targets: connectedDebugAndroidTest
83+ - os : ubuntu-latest
84+ platform : Android
85+ targets : :ktreesitter:assembleDebug
5386 - os : ubuntu-latest
5487 platform : Linux
55- targets : compileKotlinLinuxArm64 linuxX64Test
88+ targets : >-
89+ :ktreesitter:compileKotlinLinuxArm64
90+ :ktreesitter:linuxX64Test
5691 - os : windows-latest
5792 platform : Windows
58- targets : mingwX64Test
93+ targets : :ktreesitter: mingwX64Test
5994 - os : macos-latest
6095 platform : macOS/iOS
61- targets : macosX64Test macosArm64Test iosSimulatorArm64Test
96+ targets : >-
97+ :ktreesitter:macosX64Test
98+ :ktreesitter:macosArm64Test
99+ :ktreesitter:iosSimulatorArm64Test
62100 steps :
63101 - name : Checkout repository
64102 uses : actions/checkout@v4
@@ -76,11 +114,16 @@ jobs:
76114 - name : Set up cross compilation
77115 run : sudo apt-get install -qy {binutils,gcc}-aarch64-linux-gnu
78116 if : matrix.platform == 'Linux'
79- - name : Cache Kotlin/Native prebuilt
80- uses : actions/cache@v4
117+ - name : Restore Kotlin/Native prebuilt
118+ uses : actions/cache/restore @v4
81119 with :
82120 path : ${{runner.tool_cache}}/konan/kotlin-native-prebuilt-*
83121 key : konan-${{runner.os}}-prebuilt-1.9
122+ - name : Download generated files
123+ uses : actions/download-artifact@v4
124+ with :
125+ path : languages
126+ name : generated-files
84127 - name : Build JNI libraries
85128 if : matrix.platform == 'JVM'
86129 run : .github/scripts/build-jni.${{matrix.os == 'windows-latest' && 'ps1' || 'sh'}}
0 commit comments