-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use blaze for local, fast, cross-platform unit tests
- Loading branch information
Showing
5 changed files
with
137 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
blaze.dependencies = [ | ||
"com.fizzed:blaze-ssh" | ||
"com.fizzed:buildx:1.0.7" | ||
"com.fizzed:jne:4.1.1" | ||
] | ||
|
||
java.source.version = 8 |
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,50 @@ | ||
import com.fizzed.blaze.Config; | ||
import com.fizzed.blaze.Contexts; | ||
import com.fizzed.blaze.Task; | ||
import com.fizzed.buildx.Buildx; | ||
import com.fizzed.buildx.ContainerBuilder; | ||
import com.fizzed.buildx.Target; | ||
import com.fizzed.jne.*; | ||
import org.slf4j.Logger; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
|
||
import static com.fizzed.blaze.Contexts.withBaseDir; | ||
import static com.fizzed.blaze.Systems.*; | ||
import static com.fizzed.blaze.util.Globber.globber; | ||
import static java.util.Arrays.asList; | ||
import static java.util.Optional.ofNullable; | ||
|
||
public class blaze { | ||
private final Logger log = Contexts.logger(); | ||
private final Config config = Contexts.config(); | ||
private final Path projectDir = withBaseDir("../").toAbsolutePath(); | ||
private final NativeTarget localNativeTarget = NativeTarget.detect(); | ||
private final Path nativeDir = projectDir.resolve("native"); | ||
private final Path targetDir = projectDir.resolve("target"); | ||
|
||
private final List<Target> crossTargets = asList( | ||
new Target("linux", "x64").setTags("test").setHost("build-x64-linux-latest"), | ||
new Target("linux", "arm64").setTags("test").setHost("build-arm64-linux-latest"), | ||
new Target("linux", "riscv64").setTags("test").setHost("build-riscv64-linux-latest"), | ||
new Target("macos", "x64").setTags("test").setHost("build-x64-macos-latest"), | ||
new Target("macos", "arm64").setTags("test").setHost("build-arm64-macos-latest"), | ||
new Target("windows", "x64").setTags("test").setHost("build-x64-windows-latest"), | ||
new Target("windows", "arm64").setTags("test").setHost("build-arm64-windows-latest"), | ||
new Target("freebsd", "x64").setTags("test").setHost("build-x64-freebsd-latest"), | ||
new Target("openbsd", "x64").setTags("test").setHost("build-x64-openbsd-latest") | ||
); | ||
|
||
@Task(order = 1) | ||
public void cross_tests() throws Exception { | ||
new Buildx(crossTargets) | ||
.tags("test") | ||
.execute((target, project) -> { | ||
project.action("mvn", "test") | ||
.run(); | ||
}); | ||
} | ||
|
||
} |
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,79 @@ | ||
<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>blaze</groupId> | ||
<artifactId>tokyocabinet-blaze</artifactId> | ||
<version>0.0.1</version> | ||
|
||
<!-- | ||
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND! | ||
Edit or create a <blaze-script>.conf file, and re-run the generate-maven-project command. | ||
--> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
<maven.install.skip>true</maven.install.skip> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
<build> | ||
<sourceDirectory>${project.basedir}</sourceDirectory> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.fizzed</groupId> | ||
<artifactId>blaze-ivy</artifactId> | ||
<version>1.5.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.11.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>2.0.7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.typesafe</groupId> | ||
<artifactId>config</artifactId> | ||
<version>1.3.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.ivy</groupId> | ||
<artifactId>ivy</artifactId> | ||
<version>2.5.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fizzed</groupId> | ||
<artifactId>blaze-core</artifactId> | ||
<version>1.5.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>2.0.7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.zeroturnaround</groupId> | ||
<artifactId>zt-exec</artifactId> | ||
<version>1.12</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fizzed</groupId> | ||
<artifactId>blaze-ssh</artifactId> | ||
<version>1.5.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fizzed</groupId> | ||
<artifactId>buildx</artifactId> | ||
<version>1.0.7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fizzed</groupId> | ||
<artifactId>jne</artifactId> | ||
<version>4.1.1</version> | ||
</dependency> | ||
</dependencies> | ||
</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 |
---|---|---|
|
@@ -3,3 +3,4 @@ ninja-upstream | |
.vagrant | ||
.idea | ||
*.iml | ||
.buildx |