Trouble with Loom 18b5 & Gradle 7.3

I’m an early user for Project Loom and I have a project to bridge it to the reactive world:

With Loom 18b5, one needs to have targetCompatibility set to 18 in build.gradle to be able to use the --enable-preview argument for the virtual thread API. If I do this, everything builds and tests nicely under Windows. (Gradle runs on JDK 11.0.13 and the executable properties are overridden to point to loom)

However, running the build on GitHub actions, it fails immediately with:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'
Caused by: 
   Error while evaluating property 'javaVersion' of task ':compileJava'
Caused by: java.util.NoSuchElementException: No value present
at org.gradle.jvm.toolchain.internal.JavaToolchainQueryService.query(

(I have the same Loom 18b5 in a different project with targetCompatibility=17 and that project builds on GitHub Actions fine; it doesn’t use any preview api there.)

Please advise.