Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/bindings-server.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,16 @@ workflow(
""".trimIndent(),
)

cleanMavenLocal()

run(
name = "Execute the script using the bindings from the server with binding version v2",
command = """
mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
.github/workflows/test-script-consuming-jit-bindings-v2.main.kts
""".trimIndent(),
)
// TODO: Reenable after release, currently, new class "Expression" cannot be found
//cleanMavenLocal()

//run(
// name = "Execute the script using the bindings from the server with binding version v2",
// command = """
// mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
// .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
// """.trimIndent(),
//)

cleanMavenLocal()

Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/bindings-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,57 +77,49 @@ jobs:
name: 'Clean Maven Local to fetch required POMs again'
run: 'rm -rf ~/.m2/repository/'
- id: 'step-7'
name: 'Execute the script using the bindings from the server with binding version v2'
run: |-
mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
.github/workflows/test-script-consuming-jit-bindings-v2.main.kts
- id: 'step-8'
name: 'Clean Maven Local to fetch required POMs again'
run: 'rm -rf ~/.m2/repository/'
- id: 'step-9'
name: 'Execute the script using bindings but without dependency on library'
run: |-
mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
.github/workflows/test-served-bindings-depend-on-library.main.kts
- id: 'step-10'
- id: 'step-8'
name: 'Install Kotlin 1.9.0'
uses: 'fwilhe2/setup-kotlin@v1'
with:
version: '1.9.0'
- id: 'step-11'
- id: 'step-9'
name: 'Clean Maven Local to fetch required POMs again'
run: 'rm -rf ~/.m2/repository/'
- id: 'step-12'
- id: 'step-10'
name: 'Execute the script using the bindings from the server, using older Kotlin (1.9.0) as consumer'
run: |2-
cp .github/workflows/test-script-consuming-jit-bindings-v1.main.kts .github/workflows/test-script-consuming-jit-bindings-too-old-kotlin.main.kts
(.github/workflows/test-script-consuming-jit-bindings-too-old-kotlin.main.kts || true) >> output.txt 2>&1
grep "was compiled with an incompatible version of Kotlin" output.txt
- id: 'step-13'
- id: 'step-11'
name: 'Install Kotlin 2.0.0'
uses: 'fwilhe2/setup-kotlin@v1'
with:
version: '2.0.0'
- id: 'step-14'
- id: 'step-12'
name: 'Clean Maven Local to fetch required POMs again'
run: 'rm -rf ~/.m2/repository/'
- id: 'step-15'
- id: 'step-13'
name: 'Execute the script using the bindings from the server, using older Kotlin (2.0.0) as consumer'
run: |-
cp .github/workflows/test-script-consuming-jit-bindings-v1.main.kts .github/workflows/test-script-consuming-jit-bindings-older-kotlin.main.kts
.github/workflows/test-script-consuming-jit-bindings-older-kotlin.main.kts
- id: 'step-16'
- id: 'step-14'
name: 'Compile a Gradle project using the bindings from the server'
run: |-
cd .github/workflows/test-gradle-project-using-bindings-server
./gradlew build --refresh-dependencies
- id: 'step-17'
- id: 'step-15'
name: 'Fetch maven-metadata.xml for top-level action'
run: 'curl --fail http://localhost:8080/actions/checkout/maven-metadata.xml | grep ''<version>binding_version_v1___v4</version>'''
- id: 'step-18'
- id: 'step-16'
name: 'Fetch maven-metadata.xml for nested action'
run: 'curl --fail http://localhost:8080/actions/cache__save/maven-metadata.xml | grep ''<version>binding_version_v1___v4</version>'''
- id: 'step-19'
- id: 'step-17'
name: 'Print server logs'
run: 'cat jit-binding-server/logs/server.log'
if: '${{ always() }}'
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/end-to-end-tests.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.github.typesafegithub.workflows.actions.actions.*
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
import io.github.typesafegithub.workflows.actions.wandalen.WretryAction
import io.github.typesafegithub.workflows.annotations.ExperimentalKotlinLogicStep
import io.github.typesafegithub.workflows.domain.Expression
import io.github.typesafegithub.workflows.domain.JobOutputs
import io.github.typesafegithub.workflows.domain.Mode
import io.github.typesafegithub.workflows.domain.Permission
Expand Down Expand Up @@ -80,9 +81,9 @@ workflow(
Permission.Contents to Mode.None,
),
outputs = object : JobOutputs() {
var scriptKey by output()
var scriptKey2 by output()
var scriptResult by output()
var scriptKey by output<String>()
var scriptKey2 by output<String>()
var scriptResult by output<String>()
},
) {
run(
Expand Down Expand Up @@ -178,7 +179,7 @@ workflow(
name = "Some step consuming other step's output",
action = Checkout(
sshKey = expr(addAndCommit.outputs.pythonVersion),
path = expr(addAndCommit.outputs["my-unsafe-output"]),
path = addAndCommit.outputs["my-unsafe-output"].expressionString,
),
)

Expand Down Expand Up @@ -246,7 +247,7 @@ workflow(
)
jobOutputs.scriptKey = scriptStep.outputs["key"]
jobOutputs.scriptKey2 = scriptStep.outputs["key2"]
jobOutputs.scriptResult = scriptStep.outputs.result
jobOutputs.scriptResult = Expression(scriptStep.outputs.result)
}

job(
Expand All @@ -262,9 +263,9 @@ workflow(
run(
name = "use output of script",
command = """
echo ${expr { testJob1.outputs.scriptKey }}
echo ${expr { testJob1.outputs.scriptKey2 }}
echo ${expr { testJob1.outputs.scriptResult }}
echo ${testJob1.outputs.scriptKey.expressionString}
echo ${expr(testJob1.outputs.scriptKey2.expression)}
echo ${expr { testJob1.outputs.scriptResult.expression }}
""".trimIndent(),
)

Expand Down
14 changes: 8 additions & 6 deletions action-binding-generator/api/action-binding-generator.api
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ public final class io/github/typesafegithub/workflows/actionbindinggenerator/dom

public final class io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings {
public fun <init> ()V
public fun <init> (Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;Z)V
public synthetic fun <init> (Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;Z)V
public synthetic fun <init> (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/util/Map;
public final fun component2 ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
public final fun component3 ()Z
public final fun copy (Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;Z)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
public static synthetic fun copy$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ZILjava/lang/Object;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
public final fun component2 ()Ljava/util/Map;
public final fun component3 ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
public final fun component4 ()Z
public final fun copy (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;Z)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
public static synthetic fun copy$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ZILjava/lang/Object;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
public fun equals (Ljava/lang/Object;)Z
public final fun getFromFallbackVersion ()Z
public final fun getInputTypings ()Ljava/util/Map;
public final fun getOutputTypings ()Ljava/util/Map;
public final fun getSource ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing

public data class ActionTypings(
val inputTypings: Map<String, Typing> = emptyMap(),
val outputTypings: Map<String, Typing> = emptyMap(),
val source: TypingActualSource? = null,
val fromFallbackVersion: Boolean = false,
)
Loading
Loading