From c447600cd8e0d1fa675331ee6ad702a1dc662cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Catarino=20Fran=C3=A7a?= Date: Thu, 18 Jan 2024 10:53:02 -0300 Subject: [PATCH] CI: build test with zigCC --- .github/workflows/build.yml | 7 ++++--- build.zig | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23dcc8d..3afa9ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,9 @@ jobs: sudo apt-get update sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev - - name: Build + - name: Build Summary run: zig build -DzigCC --summary all - - name: Test - run: zig build test + - name: Running Test + if: runner.os != 'Windows' + run: zig build test -DzigCC diff --git a/build.zig b/build.zig index df5be5c..2f459d5 100644 --- a/build.zig +++ b/build.zig @@ -194,7 +194,7 @@ pub fn build(b: *Build) !void { if (enable_zigcc) { const zcc = buildZigCC(b); const install = b.addInstallArtifact(zcc, .{ .dest_dir = .{ .override = .{ .custom = "tools" } } }); - b.default_step.dependOn(&install.step); + b.getInstallStep().dependOn(&install.step); } // build examples @@ -233,14 +233,16 @@ pub fn build(b: *Build) !void { buildShaders(b); // build tests - const math_test = try ldcBuildStep(b, .{ - .name = "test-math", - .kind = .@"test", - .target = b.host, - .sources = &.{b.fmt("{s}/src/handmade/math.d", .{rootPath()})}, - .dflags = &.{}, - }); - b.default_step.dependOn(&math_test.step); + // fixme: not building on Windows libsokol w/ king test + if (target.result.os.tag != .windows) { + _ = try ldcBuildStep(b, .{ + .name = "test-math", + .kind = .@"test", + .target = b.host, + .sources = &.{b.fmt("{s}/src/handmade/math.d", .{rootPath()})}, + .dflags = &.{}, + }); + } } // Use LDC2 (https://github.com/ldc-developers/ldc) to compile the D examples