Skip to content

Commit 6663a6e

Browse files
authored
ci: fix compiling scripts (#1473)
Necessary adjustments for Kotlin 2.0.
1 parent a3a00ac commit 6663a6e

2 files changed

Lines changed: 41 additions & 21 deletions

File tree

.github/workflows/build.main.kts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,28 @@ workflow(
9191
run(command = "mkdocs build --site-dir public")
9292
}
9393

94-
// Doesn't work due to https://youtrack.jetbrains.com/issue/KT-68681, likely going to be fixed in Kotlin 2.0.10.
95-
// job(
96-
// id = "build_kotlin_scripts",
97-
// name = "Build Kotlin scripts",
98-
// runsOn = UbuntuLatest,
99-
// ) {
100-
// uses(action = Checkout())
101-
// run(
102-
// command = """
103-
// find -name *.main.kts -print0 | while read -d ${'$'}'\0' file
104-
// do
105-
// if [ "${'$'}file" = "./.github/workflows/end-to-end-tests.main.kts" ]; then
106-
// continue
107-
// fi
108-
//
109-
// echo "Compiling ${'$'}file..."
110-
// kotlinc -Werror -Xallow-any-scripts-in-source-roots "${'$'}file"
111-
// done
112-
// """.trimIndent()
113-
// )
114-
// }
94+
95+
job(
96+
id = "build_kotlin_scripts",
97+
name = "Build Kotlin scripts",
98+
runsOn = UbuntuLatest,
99+
) {
100+
uses(action = Checkout())
101+
run(
102+
command = """
103+
find -name *.main.kts -print0 | while read -d ${'$'}'\0' file
104+
do
105+
if [ "${'$'}file" = "./.github/workflows/end-to-end-tests.main.kts" ]; then
106+
continue
107+
fi
108+
109+
echo "Compiling ${'$'}file..."
110+
kotlinc -Werror -Xallow-any-scripts-in-source-roots -Xuse-fir-lt=false "${'$'}file"
111+
done
112+
""".trimIndent()
113+
)
114+
}
115+
115116

116117
job(
117118
id = "workflows_consistency_check",

.github/workflows/build.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ jobs:
121121
run: 'pip install -r docs/requirements.txt'
122122
- id: 'step-3'
123123
run: 'mkdocs build --site-dir public'
124+
build_kotlin_scripts:
125+
name: 'Build Kotlin scripts'
126+
runs-on: 'ubuntu-latest'
127+
needs:
128+
- 'check_yaml_consistency'
129+
steps:
130+
- id: 'step-0'
131+
uses: 'actions/checkout@v4'
132+
- id: 'step-1'
133+
run: |-
134+
find -name *.main.kts -print0 | while read -d $'\0' file
135+
do
136+
if [ "$file" = "./.github/workflows/end-to-end-tests.main.kts" ]; then
137+
continue
138+
fi
139+
140+
echo "Compiling $file..."
141+
kotlinc -Werror -Xallow-any-scripts-in-source-roots -Xuse-fir-lt=false "$file"
142+
done
124143
workflows_consistency_check:
125144
name: 'Run consistency check on all GitHub workflows'
126145
runs-on: 'ubuntu-latest'

0 commit comments

Comments
 (0)