Compare commits
2 Commits
3b249d62b9
...
cbb6116a61
Author | SHA1 | Date | |
---|---|---|---|
cbb6116a61 | |||
b603822679 |
|
@ -23,7 +23,6 @@ jobs:
|
||||||
- run: tar x -C /usr/local -f zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz
|
- run: tar x -C /usr/local -f zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz
|
||||||
- run: ln -s /usr/local/zig-linux-${ARCH}-${ZIG_VERSION}/zig /usr/local/bin/zig
|
- run: ln -s /usr/local/zig-linux-${ARCH}-${ZIG_VERSION}/zig /usr/local/bin/zig
|
||||||
- run: apt update && apt install --no-install-recommends git
|
- run: apt update && apt install --no-install-recommends git
|
||||||
- run: (cd codegen && zig build test)
|
|
||||||
- run: zig build test
|
- run: zig build test
|
||||||
- run: zig build -Dtarget=arm-linux
|
- run: zig build -Dtarget=arm-linux
|
||||||
- run: zig build -Dtarget=x86_64-windows
|
- run: zig build -Dtarget=x86_64-windows
|
||||||
|
|
19
build.zig
19
build.zig
|
@ -58,6 +58,22 @@ pub fn build(b: *Builder) !void {
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
run_step.dependOn(&run_cmd.step);
|
run_step.dependOn(&run_cmd.step);
|
||||||
|
|
||||||
|
// Creates a step for unit testing. This only builds the test executable
|
||||||
|
// but does not run it.
|
||||||
|
const unit_tests = b.addTest(.{
|
||||||
|
.root_source_file = .{ .path = "src/main.zig" },
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
});
|
||||||
|
|
||||||
|
const run_unit_tests = b.addRunArtifact(unit_tests);
|
||||||
|
|
||||||
|
// Similar to creating the run step earlier, this exposes a `test` step to
|
||||||
|
// the `zig build --help` menu, providing a way for the user to request
|
||||||
|
// running the unit tests.
|
||||||
|
const test_step = b.step("test", "Run unit tests");
|
||||||
|
test_step.dependOn(&run_unit_tests.step);
|
||||||
|
|
||||||
{
|
{
|
||||||
const cg = b.step("gen", "Generate zig service code from smithy models");
|
const cg = b.step("gen", "Generate zig service code from smithy models");
|
||||||
|
|
||||||
|
@ -66,7 +82,7 @@ pub fn build(b: *Builder) !void {
|
||||||
.root_source_file = .{ .path = "codegen/src/main.zig" },
|
.root_source_file = .{ .path = "codegen/src/main.zig" },
|
||||||
// We need this generated for the host, not the real target
|
// We need this generated for the host, not the real target
|
||||||
// .target = target,
|
// .target = target,
|
||||||
// .optimize = optimize,
|
.optimize = .ReleaseSafe,
|
||||||
});
|
});
|
||||||
cg_exe.addModule("smithy", smithy_dep.module("smithy"));
|
cg_exe.addModule("smithy", smithy_dep.module("smithy"));
|
||||||
var cg_cmd = b.addRunArtifact(cg_exe);
|
var cg_cmd = b.addRunArtifact(cg_exe);
|
||||||
|
@ -101,6 +117,7 @@ pub fn build(b: *Builder) !void {
|
||||||
|
|
||||||
cg.dependOn(&cg_cmd.step);
|
cg.dependOn(&cg_cmd.step);
|
||||||
exe.step.dependOn(cg);
|
exe.step.dependOn(cg);
|
||||||
|
unit_tests.step.dependOn(cg);
|
||||||
}
|
}
|
||||||
|
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user