Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
eroshenkoam committed Aug 23, 2023
1 parent 53a7859 commit 688e9db
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ jobs:
cache: 'gradle'
- run: ./gradlew build
- run: ./gradlew nativeImage
- uses: actions/upload-artifact@v3
with:
path: ./build/graal/xcresults
name: xcresults
retention-days: 2
- run: ./xcresults test
2 changes: 1 addition & 1 deletion src/main/java/io/eroshenkoam/xcresults/MainCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@CommandLine.Command(
name = "xcresult", mixinStandardHelpOptions = true,
subcommands = {ExportCommand.class}
subcommands = {TestCommand.class, ExportCommand.class}
)
public class MainCommand implements Runnable {

Expand Down
26 changes: 26 additions & 0 deletions src/main/java/io/eroshenkoam/xcresults/TestCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.eroshenkoam.xcresults;

import freemarker.template.TemplateException;
import io.eroshenkoam.xcresults.util.FreemarkerUtil;
import picocli.CommandLine;

import java.io.IOException;
import java.util.Map;

@CommandLine.Command(
name = "test", mixinStandardHelpOptions = true,
description = "Test template"
)
public class TestCommand implements Runnable {

@Override
public void run() {
try {
final String carouselContent = FreemarkerUtil
.render("templates/carousel.ftl", Map.of("carousel", new Object()));
} catch (IOException | TemplateException e) {
throw new RuntimeException(e);
}
}

}

0 comments on commit 688e9db

Please sign in to comment.