|
| 1 | +#!/usr/bin/env kotlin |
| 2 | +@file:Repository("file://~/.m2/repository/") |
| 3 | +@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.14.1-SNAPSHOT") |
| 4 | +@file:Repository("https://github-workflows-kt-bindings.colman.com.br/binding/") |
| 5 | +@file:DependsOn("actions:checkout:v4") |
| 6 | +@file:DependsOn("actions:setup-java:v4") |
| 7 | +@file:DependsOn("gradle:actions__setup-gradle:v3") |
| 8 | + |
| 9 | +import io.github.typesafegithub.workflows.actions.actions.Checkout |
| 10 | +import io.github.typesafegithub.workflows.actions.actions.SetupJava |
| 11 | +import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle |
| 12 | +import io.github.typesafegithub.workflows.domain.RunnerType |
| 13 | +import io.github.typesafegithub.workflows.domain.triggers.PullRequest |
| 14 | +import io.github.typesafegithub.workflows.domain.triggers.Push |
| 15 | +import io.github.typesafegithub.workflows.dsl.workflow |
| 16 | +import io.github.typesafegithub.workflows.yaml.writeToFile |
| 17 | + |
| 18 | +workflow( |
| 19 | + name = "End-to-end tests", |
| 20 | + on = listOf( |
| 21 | + Push(branches = listOf("main")), |
| 22 | + PullRequest(), |
| 23 | + ), |
| 24 | + yamlConsistencyJobAdditionalSteps = { |
| 25 | + uses( |
| 26 | + name = "Set up JDK", |
| 27 | + action = SetupJava( |
| 28 | + javaVersion = "11", |
| 29 | + distribution = SetupJava.Distribution.Zulu, |
| 30 | + ), |
| 31 | + ) |
| 32 | + uses(action = ActionsSetupGradle(generateJobSummary = false)) |
| 33 | + run( |
| 34 | + name = "Publish to Maven local", |
| 35 | + command = "./gradlew publishToMavenLocal", |
| 36 | + ) |
| 37 | + }, |
| 38 | + sourceFile = __FILE__.toPath(), |
| 39 | +) { |
| 40 | + job( |
| 41 | + id = "main-job", |
| 42 | + name = "Main job", |
| 43 | + runsOn = RunnerType.UbuntuLatest, |
| 44 | + ) { |
| 45 | + uses(action = Checkout()) |
| 46 | + run(command = "echo 'Hello world!'") |
| 47 | + } |
| 48 | +}.writeToFile() |
0 commit comments