Skip to content

Commit 930544a

Browse files
committed
Add build arguments to ci.json
1 parent 17b51fe commit 930544a

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.github/workflows/test-all-metadata.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: "Test all metadata"
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
paths:
9+
- 'ci.json'
510

611
concurrency:
712
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"

ci.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"buildArgs": ["-verbose", "-Ob"],
23
"generateMatrixBatchedCoordinates": {
34
"java": ["17", "21", "25", "latest-ea"],
45
"os": ["ubuntu-latest"]

tests/tck-build-logic/src/main/groovy/org.graalvm.internal.tck.gradle

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77

88

9+
import groovy.json.JsonSlurper
10+
911
plugins {
1012
id 'org.graalvm.internal.tck-base'
1113
id 'checkstyle'
@@ -51,6 +53,26 @@ String overrideVal = System.getenv("GVM_TCK_EXCLUDE") ?: providers.gradlePropert
5153
overrideVal = overrideVal ?: "false"
5254
boolean override = overrideVal.toBoolean()
5355

56+
// Determine native-image build arguments from ci.json.
57+
def ciJsonFile = rootProject.file("ci.json")
58+
def nativeImageArgs = []
59+
if (ciJsonFile.exists()) {
60+
try {
61+
def parsed = new JsonSlurper().parse(ciJsonFile)
62+
def argsFromCi = parsed?.buildArgs
63+
if (argsFromCi instanceof Collection && !argsFromCi.isEmpty()) {
64+
nativeImageArgs = argsFromCi.collect { it.toString() }
65+
// Post-process placeholders in args
66+
nativeImageArgs = nativeImageArgs.collect { arg ->
67+
arg.replace('{{library.version}}', libraryVersion)
68+
.replace('{{library.coordinates}}', libraryGAV)
69+
}
70+
}
71+
} catch (Exception ignored) {
72+
throw new GradleException("ci.json must contain the buildArgs")
73+
}
74+
}
75+
5476
tck.testedLibraryVersion = libraryVersion
5577
// This value can be used to request specific library version to test with.
5678

@@ -74,12 +96,13 @@ graalvmNative {
7496
uri(tck.metadataRoot.get().asFile)
7597
}
7698
binaries {
99+
all {
100+
buildArgs.addAll(nativeImageArgs)
101+
}
77102
test {
78103
if (override) {
79104
excludeConfig.put(libraryGAV, [".*"])
80105
}
81-
verbose = true
82-
quickBuild = true
83106
}
84107
}
85108
}

0 commit comments

Comments
 (0)