-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(abg): support different binding versions on different server routes
- Loading branch information
Showing
10 changed files
with
232 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,46 +57,54 @@ 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 v1 route' | ||
run: |- | ||
mv .github/workflows/test-script-consuming-jit-bindings-v1.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v1.main.kts | ||
.github/workflows/test-script-consuming-jit-bindings-v1.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-8' | ||
- id: 'step-10' | ||
name: 'Install Kotlin 1.9.0' | ||
uses: 'fwilhe2/[email protected]' | ||
with: | ||
version: '1.9.0' | ||
- id: 'step-9' | ||
- id: 'step-11' | ||
name: 'Clean Maven Local to fetch required POMs again' | ||
run: 'rm -rf ~/.m2/repository/' | ||
- id: 'step-10' | ||
- id: 'step-12' | ||
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.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-11' | ||
- id: 'step-13' | ||
name: 'Install Kotlin 2.0.0' | ||
uses: 'fwilhe2/[email protected]' | ||
with: | ||
version: '2.0.0' | ||
- id: 'step-12' | ||
- id: 'step-14' | ||
name: 'Clean Maven Local to fetch required POMs again' | ||
run: 'rm -rf ~/.m2/repository/' | ||
- id: 'step-13' | ||
- id: 'step-15' | ||
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.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-14' | ||
- id: 'step-16' | ||
name: 'Compile a Gradle project using the bindings from the server' | ||
run: |- | ||
cd .github/workflows/test-gradle-project-using-bindings-server | ||
./gradlew build | ||
- id: 'step-15' | ||
- id: 'step-17' | ||
name: 'Fetch maven-metadata.xml for top-level action' | ||
run: 'curl --fail http://localhost:8080/actions/checkout/maven-metadata.xml | grep ''<version>v4</version>''' | ||
- id: 'step-16' | ||
- id: 'step-18' | ||
name: 'Fetch maven-metadata.xml for nested action' | ||
run: 'curl --fail http://localhost:8080/actions/cache__save/maven-metadata.xml | grep ''<version>v4</version>''' | ||
deploy: | ||
|
33 changes: 33 additions & 0 deletions
33
.github/workflows/test-script-consuming-jit-bindings-v1.main.do-not-compile.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env kotlin | ||
@file:Repository("https://repo.maven.apache.org/maven2/") | ||
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.13.0") | ||
|
||
@file:Repository("http://localhost:8080/v1") | ||
|
||
// Regular, top-level action. | ||
@file:DependsOn("actions:checkout:v4") | ||
|
||
// Nested action. | ||
@file:DependsOn("gradle:actions__setup-gradle:v3") | ||
|
||
// Using specific version. | ||
@file:DependsOn("actions:cache:v3.3.3") | ||
|
||
// Always untyped action. | ||
@file:DependsOn("typesafegithub:always-untyped-action-for-tests:v1") | ||
|
||
import io.github.typesafegithub.workflows.actions.actions.Cache | ||
import io.github.typesafegithub.workflows.actions.actions.Checkout | ||
import io.github.typesafegithub.workflows.actions.actions.Checkout_Untyped | ||
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle | ||
import io.github.typesafegithub.workflows.actions.typesafegithub.AlwaysUntypedActionForTests_Untyped | ||
|
||
println(Checkout_Untyped(fetchTags_Untyped = "false")) | ||
println(Checkout(fetchTags = false)) | ||
println(Checkout(fetchTags_Untyped = "false")) | ||
println(AlwaysUntypedActionForTests_Untyped(foobar_Untyped = "baz")) | ||
println(ActionsSetupGradle()) | ||
println(Cache(path = listOf("some-path"), key = "some-key")) | ||
|
||
// Ensure that 'copy(...)' method is exposed. | ||
Checkout(fetchTags = false).copy(fetchTags = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...in/io/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.typesafegithub.workflows.actionbindinggenerator.versioning | ||
|
||
public enum class BindingVersion( | ||
public val isDeprecated: Boolean = false, | ||
public val isExperimental: Boolean = true, | ||
public val libraryVersion: String, | ||
) { | ||
V1(isExperimental = false, libraryVersion = "3.0.2"), | ||
; | ||
|
||
override fun toString(): String = super.toString().lowercase() | ||
} |
Oops, something went wrong.