-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow test for native image
- Loading branch information
1 parent
ee173a5
commit 9e288bd
Showing
8 changed files
with
158 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: avaje-config native image | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '40 0 1 1 6' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: '21' | ||
distribution: 'graalvm' | ||
cache: 'maven' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Versions | ||
run: | | ||
echo "GRAALVM_HOME: $GRAALVM_HOME" | ||
echo "JAVA_HOME: $JAVA_HOME" | ||
java --version | ||
native-image --version | ||
- name: Build with Maven | ||
run: | | ||
mvn clean install -DskipTests | ||
cd tests/test-native-image | ||
mvn clean package -Pnative | ||
./target/test-native |
13 changes: 13 additions & 0 deletions
13
...rc/main/resources/META-INF/native-image/io.avaje.config.avaje-config/resource-config.json
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,13 @@ | ||
{ | ||
"resources": [ | ||
{ | ||
"pattern": "application.properties" | ||
}, | ||
{ | ||
"pattern": "application.yaml" | ||
}, | ||
{ | ||
"pattern": "application.yml" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.avaje</groupId> | ||
<artifactId>java11-oss</artifactId> | ||
<version>3.12</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<artifactId>tests</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>test-native-image</module> | ||
</modules> | ||
|
||
</project> |
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,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.example</groupId> | ||
<artifactId>test-native</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<maven.compiler.release>21</maven.compiler.release> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<version.plugin.nativeimage>0.9.27</version.plugin.nativeimage> | ||
<mainClass>org.example.Main</mainClass> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.avaje</groupId> | ||
<artifactId>avaje-config</artifactId> | ||
<version>3.9-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.graalvm.buildtools</groupId> | ||
<artifactId>native-maven-plugin</artifactId> | ||
<version>${version.plugin.nativeimage}</version> | ||
<executions> | ||
<execution> | ||
<id>build-native</id> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<buildArgs> | ||
<buildArg>--no-fallback</buildArg> | ||
<buildArg>--allow-incomplete-classpath</buildArg> | ||
</buildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
11 changes: 11 additions & 0 deletions
11
tests/test-native-image/src/main/java/org/example/Main.java
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,11 @@ | ||
package org.example; | ||
|
||
import io.avaje.config.Config; | ||
|
||
public class Main { | ||
|
||
public static void main(String[] args) { | ||
String val = Config.get("hello.world", "not-set"); | ||
System.out.println("Hello - " + val); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/test-native-image/src/main/resources/application.properties
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 @@ | ||
hello.world=Rob |