From 0caa5d4748110abb5a8c23f6cb2e9c1a2a4dc140 Mon Sep 17 00:00:00 2001 From: James Ward Date: Mon, 6 Jan 2025 08:56:40 -0700 Subject: [PATCH] add mavenTestSteps --- src/GitHubActionJava.pkl | 13 +++++++++++++ src/PklProject | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/GitHubActionJava.pkl b/src/GitHubActionJava.pkl index 127642e..baba5d7 100644 --- a/src/GitHubActionJava.pkl +++ b/src/GitHubActionJava.pkl @@ -23,3 +23,16 @@ function gradleTestSteps(taskString: String(!isEmpty)?, workingDirectory: String `working-directory` = workingDirectory } } + +function mavenTestSteps(taskString: String(!isEmpty)?, workingDirectory: String?, distribution: String?, javaVersion: String?): Listing = new { + new { + uses = "actions/checkout@v4" + } + + setupJava(distribution, javaVersion, "maven") + + new { + run = "./mvnw \(taskString ?? "test")" + `working-directory` = workingDirectory + } +} diff --git a/src/PklProject b/src/PklProject index bfba314..3b68ef8 100644 --- a/src/PklProject +++ b/src/PklProject @@ -6,10 +6,10 @@ package { "James Ward " } version = read?("env:VERSION")?.replaceFirst("\(name)@", "") ?? "0.0.1-SNAPSHOT" - baseUri = "package://jamesward.github.com/pklgha" + baseUri = "package://pkg.pkl-lang.org/github.com/jamesward/pklgha" packageZipUrl = "https://github.com/jamesward/pklgha/releases/download/\(name)@\(version)/\(name)@\(version).zip" sourceCode = "https://github.com/jamesward/pklgha" - sourceCodeUrlScheme = "\(sourceCode)/blob/\(name)@\(version)%{path}#L%{line}-L%{endLine}" + sourceCodeUrlScheme = "\(sourceCode)/blob/\(name)@\(version)/src%{path}#L%{line}-L%{endLine}" documentation = "https://jamesward.github.io/pklgha" license = "Apache-2.0" description = """