Skip to content

Commit ff26830

Browse files
committed
feat(abg)!: Allow to wire typed outputs to matching typed inputs
1 parent 0ddea45 commit ff26830

File tree

31 files changed

+1304
-447
lines changed

31 files changed

+1304
-447
lines changed

.github/workflows/bindings-server.main.kts

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,35 +79,36 @@ workflow(
7979
}
8080
}
8181

82-
cleanMavenLocal()
83-
84-
run(
85-
name = "Execute the script using the bindings from the serve - with /binding",
86-
command = """
87-
mv .github/workflows/test-script-consuming-jit-bindings-old.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-old.main.kts
88-
.github/workflows/test-script-consuming-jit-bindings-old.main.kts
89-
""".trimIndent(),
90-
)
91-
92-
cleanMavenLocal()
93-
94-
run(
95-
name = "Execute the script using the bindings from the server",
96-
command = """
97-
mv .github/workflows/test-script-consuming-jit-bindings.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings.main.kts
98-
.github/workflows/test-script-consuming-jit-bindings.main.kts
99-
""".trimIndent(),
100-
)
101-
102-
cleanMavenLocal()
103-
104-
run(
105-
name = "Execute the script using bindings but without dependency on library",
106-
command = """
107-
mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
108-
.github/workflows/test-served-bindings-depend-on-library.main.kts
109-
""".trimIndent(),
110-
)
82+
// TODO: Reenable after release, currently, new class "Expression" cannot be found
83+
//cleanMavenLocal()
84+
85+
//run(
86+
// name = "Execute the script using the bindings from the serve - with /binding",
87+
// command = """
88+
// mv .github/workflows/test-script-consuming-jit-bindings-old.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-old.main.kts
89+
// .github/workflows/test-script-consuming-jit-bindings-old.main.kts
90+
// """.trimIndent(),
91+
//)
92+
93+
//cleanMavenLocal()
94+
95+
//run(
96+
// name = "Execute the script using the bindings from the server",
97+
// command = """
98+
// mv .github/workflows/test-script-consuming-jit-bindings.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings.main.kts
99+
// .github/workflows/test-script-consuming-jit-bindings.main.kts
100+
// """.trimIndent(),
101+
//)
102+
103+
//cleanMavenLocal()
104+
105+
//run(
106+
// name = "Execute the script using bindings but without dependency on library",
107+
// command = """
108+
// mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
109+
// .github/workflows/test-served-bindings-depend-on-library.main.kts
110+
// """.trimIndent(),
111+
//)
111112

112113
run(
113114
name = "Fetch maven-metadata.xml for top-level action - with /binding",

.github/workflows/bindings-server.yaml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,15 @@ jobs:
4646
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
4747
run: 'GHWKT_RUN_STEP=''end-to-end-test:step-3'' ''.github/workflows/bindings-server.main.kts'''
4848
- id: 'step-4'
49-
name: 'Clean Maven Local to fetch required POMs again'
50-
run: 'rm -rf ~/.m2/repository/'
51-
- id: 'step-5'
52-
name: 'Execute the script using the bindings from the serve - with /binding'
53-
run: |-
54-
mv .github/workflows/test-script-consuming-jit-bindings-old.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-old.main.kts
55-
.github/workflows/test-script-consuming-jit-bindings-old.main.kts
56-
- id: 'step-6'
57-
name: 'Clean Maven Local to fetch required POMs again'
58-
run: 'rm -rf ~/.m2/repository/'
59-
- id: 'step-7'
60-
name: 'Execute the script using the bindings from the server'
61-
run: |-
62-
mv .github/workflows/test-script-consuming-jit-bindings.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings.main.kts
63-
.github/workflows/test-script-consuming-jit-bindings.main.kts
64-
- id: 'step-8'
65-
name: 'Clean Maven Local to fetch required POMs again'
66-
run: 'rm -rf ~/.m2/repository/'
67-
- id: 'step-9'
68-
name: 'Execute the script using bindings but without dependency on library'
69-
run: |-
70-
mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
71-
.github/workflows/test-served-bindings-depend-on-library.main.kts
72-
- id: 'step-10'
7349
name: 'Fetch maven-metadata.xml for top-level action - with /binding'
7450
run: 'curl --fail http://localhost:8080/binding/actions/checkout/maven-metadata.xml | grep ''<version>v4</version>'''
75-
- id: 'step-11'
51+
- id: 'step-5'
7652
name: 'Fetch maven-metadata.xml for nested action - with /binding'
7753
run: 'curl --fail http://localhost:8080/binding/actions/cache__save/maven-metadata.xml | grep ''<version>v4</version>'''
78-
- id: 'step-12'
54+
- id: 'step-6'
7955
name: 'Fetch maven-metadata.xml for top-level action'
8056
run: 'curl --fail http://localhost:8080/actions/checkout/maven-metadata.xml | grep ''<version>v4</version>'''
81-
- id: 'step-13'
57+
- id: 'step-7'
8258
name: 'Fetch maven-metadata.xml for nested action'
8359
run: 'curl --fail http://localhost:8080/actions/cache__save/maven-metadata.xml | grep ''<version>v4</version>'''
8460
deploy:

.github/workflows/end-to-end-tests.main.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ workflow(
179179
name = "Some step consuming other step's output",
180180
action = Checkout(
181181
sshKey = expr(addAndCommit.outputs.pythonVersion),
182-
path = expr(addAndCommit.outputs["my-unsafe-output"]),
182+
path = addAndCommit.outputs["my-unsafe-output"].expressionString,
183183
),
184184
)
185185

@@ -232,8 +232,8 @@ workflow(
232232
""".trimIndent(),
233233
),
234234
)
235-
jobOutputs.scriptKey = scriptStep.outputs["key"]
236-
jobOutputs.scriptKey2 = scriptStep.outputs["key2"]
235+
jobOutputs.scriptKey = scriptStep.outputs["key"].expression
236+
jobOutputs.scriptKey2 = scriptStep.outputs["key2"].expression
237237
jobOutputs.scriptResult = scriptStep.outputs.result
238238
}
239239

action-binding-generator/api/action-binding-generator.api

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ public final class io/github/typesafegithub/workflows/actionbindinggenerator/dom
2323
public static final fun isTopLevel (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;)Z
2424
}
2525

26+
public final class io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings {
27+
public fun <init> ()V
28+
public fun <init> (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;)V
29+
public synthetic fun <init> (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
30+
public final fun component1 ()Ljava/util/Map;
31+
public final fun component2 ()Ljava/util/Map;
32+
public final fun component3 ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
33+
public final fun copy (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
34+
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;ILjava/lang/Object;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
35+
public fun equals (Ljava/lang/Object;)Z
36+
public final fun getInputTypings ()Ljava/util/Map;
37+
public final fun getOutputTypings ()Ljava/util/Map;
38+
public final fun getSource ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
39+
public fun hashCode ()I
40+
public fun toString ()Ljava/lang/String;
41+
}
42+
2643
public final class io/github/typesafegithub/workflows/actionbindinggenerator/domain/CommitHash : io/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision {
2744
public fun <init> (Ljava/lang/String;)V
2845
public final fun component1 ()Ljava/lang/String;
@@ -72,8 +89,8 @@ public final class io/github/typesafegithub/workflows/actionbindinggenerator/gen
7289
}
7390

7491
public final class io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationKt {
75-
public static final fun generateBinding (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lkotlin/Pair;)Ljava/util/List;
76-
public static synthetic fun generateBinding$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lkotlin/Pair;ILjava/lang/Object;)Ljava/util/List;
92+
public static final fun generateBinding (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;)Ljava/util/List;
93+
public static synthetic fun generateBinding$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;ILjava/lang/Object;)Ljava/util/List;
7794
}
7895

7996
public final class io/github/typesafegithub/workflows/actionbindinggenerator/metadata/Input {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package io.github.typesafegithub.workflows.actionbindinggenerator.domain
2+
3+
import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing
4+
5+
public data class ActionTypings(
6+
val inputTypings: Map<String, Typing> = emptyMap(),
7+
val outputTypings: Map<String, Typing> = emptyMap(),
8+
val source: TypingActualSource? = null,
9+
)

0 commit comments

Comments
 (0)