diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 146c49c..b5b61d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ concurrency: group: ${{ github.ref }} cancel-in-progress: true +env: + PATH: "/" + jobs: build: runs-on: ubuntu-latest diff --git a/build.zig b/build.zig index 125aab7..6f5e5cd 100644 --- a/build.zig +++ b/build.zig @@ -60,6 +60,7 @@ pub fn build(b: *std.Build) !void { .link_libc = true, }); const run_tests = b.addRunArtifact(tests); + run_tests.step.dependOn(b.getInstallStep()); test_step.dependOn(&run_tests.step); } diff --git a/src/test.zig b/src/test.zig index 275cd4f..612b8e8 100644 --- a/src/test.zig +++ b/src/test.zig @@ -166,9 +166,13 @@ fn runCommand(db_path: []const u8, input: []const u8) !void { for (try splitArg(input)) |arg| { try argv.append(arg); } + var env = std.process.EnvMap.init(allocator); + try env.put("PATH", "/"); const result = try std.ChildProcess.exec(.{ .allocator = allocator, .argv = argv.items, + // Work around https://github.com/ziglang/zig/issues/12816 + .env_map = &env, }); if (print_output) { std.debug.print("{s} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", .{input});