Skip to content

Commit

Permalink
Add buildx support for cross platform testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Jan 15, 2025
1 parent 993c540 commit d59fb87
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .blaze/blaze.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ java.source.version=11
blaze.dependencies = [
"com.fizzed:blaze-archive",
"com.fizzed:blaze-http",
"com.fizzed:jne:4.3.0"
"com.fizzed:jne:4.3.0",
"com.fizzed:blaze-ssh",
"com.fizzed:buildx:1.2.0"
]
32 changes: 32 additions & 0 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import com.fizzed.blaze.Config;
import com.fizzed.blaze.Contexts;
import com.fizzed.blaze.Task;
import com.fizzed.buildx.Buildx;
import com.fizzed.buildx.Target;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeLanguageModel;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.slf4j.Logger;
import java.nio.file.Path;
import java.util.List;

import static com.fizzed.blaze.Archives.unarchive;
import static com.fizzed.blaze.Https.*;
import static com.fizzed.blaze.Systems.*;
import static java.util.Arrays.asList;

public class blaze {
private final Logger log = Contexts.logger();
Expand All @@ -32,6 +37,7 @@ public void downloadNatsServer() throws Exception {
final NativeLanguageModel nlm = new NativeLanguageModel()
.add("version", this.natsVersion)
.add(OperatingSystem.MACOS, "darwin")
.add(HardwareArchitecture.ARMHF, "arm7")
.add(HardwareArchitecture.X64, "amd64")
.add(HardwareArchitecture.X32, "386");

Expand Down Expand Up @@ -75,4 +81,30 @@ public void downloadNatsServer() throws Exception {
}
}

private final List<Target> crossTestTargets = asList(
new Target("linux", "x64").setTags("test").setHost("bmh-build-x64-linux-latest"),
new Target("linux", "arm64").setTags("test").setHost("bmh-build-arm64-linux-latest"),
//new Target("linux", "riscv64").setTags("test").setHost("bmh-build-riscv64-linux-latest"),
//new Target("linux", "armhf").setTags("test").setHost("bmh-build-armhf-linux-latest"),
new Target("linux_musl", "x64").setTags("test").setHost("bmh-build-x64-linux-musl-latest"),
new Target("macos", "x64").setTags("test").setHost("bmh-build-x64-macos-latest"),
new Target("macos", "arm64").setTags("test").setHost("bmh-build-arm64-macos-latest"),
new Target("windows", "x64").setTags("test").setHost("bmh-build-x64-windows-latest"),
new Target("windows", "arm64").setTags("test").setHost("bmh-build-arm64-windows-latest"),
new Target("freebsd", "x64").setTags("test").setHost("bmh-build-x64-freebsd-latest")
//new Target("openbsd", "x64").setTags("test").setHost("bmh-build-x64-openbsd-latest")
);

@Task(order = 53)
public void cross_tests() throws Exception {
new Buildx(crossTestTargets)
.tags("test")
.execute((target, project) -> {
project.action("java", "-jar", "blaze.jar", "setup")
.run();
project.action("mvn", "clean", "test")
.run();
});
}

}
28 changes: 19 additions & 9 deletions .blaze/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<sourceDirectory>${project.basedir}</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ivy</artifactId>
<version>1.6.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
Expand All @@ -33,7 +28,7 @@
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-core</artifactId>
<version>1.6.2-SNAPSHOT</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand All @@ -45,6 +40,11 @@
<artifactId>config</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ivy</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand All @@ -63,17 +63,27 @@
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-archive</artifactId>
<version>1.6.2-SNAPSHOT</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-http</artifactId>
<version>1.6.2-SNAPSHOT</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
<version>4.2.0</version>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ssh</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>buildx</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
target
.resources
rabbitmq*
.buildx
8 changes: 8 additions & 0 deletions buildx-results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Buildx Results
--------------
Cross platform tests use the Buildx project: https://github.com/fizzed/buildx
Commit: 993c540a09b86b579bf76c40f261285f2190856a
Date: 2025-01-15T16:44:21.179508Z[UTC]

linux_musl-x64 success

0 comments on commit d59fb87

Please sign in to comment.