perform build before test/add gen as a dependency for test
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
b82dc3f50d
commit
487abc057f
|
@ -18,8 +18,8 @@ steps:
|
||||||
- rm /usr/local/bin/zig
|
- rm /usr/local/bin/zig
|
||||||
- ln -s /usr/local/zig-linux-x86_64-0.9.0-dev.321+15a030ef3/zig /usr/local/bin/zig
|
- ln -s /usr/local/zig-linux-x86_64-0.9.0-dev.321+15a030ef3/zig /usr/local/bin/zig
|
||||||
- (cd codegen && zig build test)
|
- (cd codegen && zig build test)
|
||||||
|
- zig build # implicitly does a codegen
|
||||||
- zig build test
|
- zig build test
|
||||||
- zig build
|
|
||||||
- name: notify
|
- name: notify
|
||||||
image: plugins/matrix
|
image: plugins/matrix
|
||||||
when:
|
when:
|
||||||
|
|
29
build.zig
29
build.zig
|
@ -17,20 +17,6 @@ pub fn build(b: *Builder) !void {
|
||||||
// https://github.com/ziglang/zig/issues/855
|
// https://github.com/ziglang/zig/issues/855
|
||||||
exe.addPackagePath("smithy", "smithy/src/smithy.zig");
|
exe.addPackagePath("smithy", "smithy/src/smithy.zig");
|
||||||
|
|
||||||
// TODO: Support > linux
|
|
||||||
// TODO: Get a better cache in place
|
|
||||||
if (std.builtin.os.tag == .linux) {
|
|
||||||
const codegen = b.step("gen", "Generate zig service code from smithy models");
|
|
||||||
codegen.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", "cd codegen && zig build" }).step);
|
|
||||||
codegen.dependOn(&b.addSystemCommand(&.{
|
|
||||||
"/bin/sh", "-c",
|
|
||||||
\\ mkdir -p src/models/ && \
|
|
||||||
\\ [ -f src/models/service_manifest.zig ] || \
|
|
||||||
\\ ( cd codegen/models && ../codegen *.json && mv *.zig ../../src/models )
|
|
||||||
}).step);
|
|
||||||
b.getInstallStep().dependOn(codegen);
|
|
||||||
}
|
|
||||||
|
|
||||||
exe.addCSourceFile("src/bitfield-workaround.c", &[_][]const u8{"-std=c99"});
|
exe.addCSourceFile("src/bitfield-workaround.c", &[_][]const u8{"-std=c99"});
|
||||||
const c_include_dirs = .{
|
const c_include_dirs = .{
|
||||||
"./src/",
|
"./src/",
|
||||||
|
@ -96,4 +82,19 @@ pub fn build(b: *Builder) !void {
|
||||||
test_step.dependOn(&t.step);
|
test_step.dependOn(&t.step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Support > linux
|
||||||
|
// TODO: Get a better cache in place
|
||||||
|
if (std.builtin.os.tag == .linux) {
|
||||||
|
const codegen = b.step("gen", "Generate zig service code from smithy models");
|
||||||
|
codegen.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", "cd codegen && zig build" }).step);
|
||||||
|
codegen.dependOn(&b.addSystemCommand(&.{
|
||||||
|
"/bin/sh", "-c",
|
||||||
|
\\ mkdir -p src/models/ && \
|
||||||
|
\\ [ -f src/models/service_manifest.zig ] || \
|
||||||
|
\\ ( cd codegen/models && ../codegen *.json && mv *.zig ../../src/models )
|
||||||
|
}).step);
|
||||||
|
b.getInstallStep().dependOn(codegen);
|
||||||
|
test_step.dependOn(codegen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user