Switch to GH runner
This commit is contained in:
parent
ff08270b6b
commit
340562038c
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -59,7 +59,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ x86_64-linux-znver4 ]
|
||||
os: [ ubuntu-24.04 ]
|
||||
BIRTH_ZIG_BUILD_TYPE: ${{ fromJSON(needs.generate-config.outputs.BIRTH_ZIG_BUILD_TYPES) }}
|
||||
ENABLE_LLVM: [ true, false ]
|
||||
SYSTEM_LLVM: [ true, false ]
|
||||
@ -74,6 +74,8 @@ jobs:
|
||||
- uses: mlugg/setup-zig@v1
|
||||
with:
|
||||
version: master
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y llvm-dev liblld-dev
|
||||
- name: Build and test
|
||||
run: |
|
||||
zig build test --summary all -Denable_llvm=${{matrix.ENABLE_LLVM}} -Doptimize=${{matrix.BIRTH_ZIG_BUILD_TYPE}} -Dsystem_llvm=${{matrix.SYSTEM_LLVM}}
|
||||
|
52
build.zig
52
build.zig
@ -79,8 +79,56 @@ const LLVM = struct {
|
||||
else => "HOME",
|
||||
};
|
||||
const home_path = env.get(home_env) orelse unreachable;
|
||||
const full_path = try std.mem.concat(b.allocator, u8, &.{ home_path, "/Downloads/llvm-", @tagName(target.result.cpu.arch), "-", @tagName(target.result.os.tag), "-", @tagName(CmakeBuildType.from_zig_build_type(optimize)), "/bin/llvm-config" });
|
||||
const f = std.fs.cwd().openFile(full_path, .{}) catch return error.llvm_not_found;
|
||||
const download_dir = try std.mem.concat(b.allocator, u8, &.{ home_path, "/Downloads" });
|
||||
std.fs.makeDirAbsolute(download_dir) catch {};
|
||||
const llvm_base = try std.mem.concat(b.allocator, u8, &.{ "llvm-", @tagName(target.result.cpu.arch), "-", @tagName(target.result.os.tag), "-", @tagName(CmakeBuildType.from_zig_build_type(optimize)) });
|
||||
const base = try std.mem.concat(b.allocator, u8, &.{ download_dir, "/", llvm_base });
|
||||
const full_path = try std.mem.concat(b.allocator, u8, &.{ base, "/bin/llvm-config" });
|
||||
|
||||
const f = std.fs.cwd().openFile(full_path, .{}) catch {
|
||||
const url = try std.mem.concat(b.allocator, u8, &.{ "https://github.com/birth-software/llvm/releases/download/v19.1.7/", llvm_base, ".7z" });
|
||||
var result = try std.process.Child.run(.{
|
||||
.allocator = b.allocator,
|
||||
.argv = &.{ "wget", "-P", download_dir, url },
|
||||
.max_output_bytes = std.math.maxInt(usize),
|
||||
});
|
||||
var success = false;
|
||||
switch (result.term) {
|
||||
.Exited => |exit_code| {
|
||||
success = exit_code == 0;
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
std.debug.print("{s}\n{s}\n", .{ result.stdout, result.stderr });
|
||||
}
|
||||
|
||||
if (success) {
|
||||
const file_7z = try std.mem.concat(b.allocator, u8, &.{ base, ".7z" });
|
||||
result = try std.process.Child.run(.{
|
||||
.allocator = b.allocator,
|
||||
.argv = &.{ "7z", "x", try std.mem.concat(b.allocator, u8, &.{ "-o", download_dir }), file_7z },
|
||||
.max_output_bytes = std.math.maxInt(usize),
|
||||
});
|
||||
success = false;
|
||||
switch (result.term) {
|
||||
.Exited => |exit_code| {
|
||||
success = exit_code == 0;
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
std.debug.print("{s}\n{s}\n", .{ result.stdout, result.stderr });
|
||||
}
|
||||
|
||||
break :blk full_path;
|
||||
}
|
||||
|
||||
return error.llvm_not_found;
|
||||
};
|
||||
|
||||
f.close();
|
||||
break :blk full_path;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user