mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
Merge pull request #1742 from mitchellh/macos-matrix
ci: add renderer, font engine macOS build+test matrix
This commit is contained in:
35
.github/workflows/test.yml
vendored
35
.github/workflows/test.yml
vendored
@ -172,6 +172,41 @@ jobs:
|
|||||||
cd macos
|
cd macos
|
||||||
xcodebuild -target Ghostty-iOS "CODE_SIGNING_ALLOWED=NO"
|
xcodebuild -target Ghostty-iOS "CODE_SIGNING_ALLOWED=NO"
|
||||||
|
|
||||||
|
build-macos-matrix:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
renderer: [opengl, metal]
|
||||||
|
|
||||||
|
font_backend:
|
||||||
|
[
|
||||||
|
freetype,
|
||||||
|
coretext,
|
||||||
|
coretext_freetype,
|
||||||
|
coretext_harfbuzz,
|
||||||
|
coretext_noshape,
|
||||||
|
]
|
||||||
|
runs-on: namespace-profile-ghostty-macos
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Install Nix and use that to run our tests so our environment matches exactly.
|
||||||
|
- uses: cachix/install-nix-action@v26
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
- uses: cachix/cachix-action@v14
|
||||||
|
with:
|
||||||
|
name: ghostty
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: nix develop -c zig build test -Dapp-runtime=glfw -Drenderer=${{ matrix.renderer }} -Dfont-backend=${{ matrix.font_backend }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: nix develop -c zig build -Dapp-runtime=glfw -Drenderer=${{ matrix.renderer }} -Dfont-backend=${{ matrix.font_backend }}
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
# this will not stop other jobs from running
|
# this will not stop other jobs from running
|
||||||
|
@ -380,12 +380,14 @@ test getIndex {
|
|||||||
var c = try Collection.init(alloc);
|
var c = try Collection.init(alloc);
|
||||||
c.load_options = .{ .library = lib };
|
c.load_options = .{ .library = lib };
|
||||||
|
|
||||||
|
{
|
||||||
|
errdefer c.deinit(alloc);
|
||||||
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
||||||
lib,
|
lib,
|
||||||
testFont,
|
testFont,
|
||||||
.{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } },
|
.{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } },
|
||||||
) });
|
) });
|
||||||
if (font.options.backend != .coretext) {
|
if (comptime !font.options.backend.hasCoretext()) {
|
||||||
// Coretext doesn't support Noto's format
|
// Coretext doesn't support Noto's format
|
||||||
_ = try c.add(
|
_ = try c.add(
|
||||||
alloc,
|
alloc,
|
||||||
@ -406,6 +408,7 @@ test getIndex {
|
|||||||
.{ .size = .{ .points = 12 } },
|
.{ .size = .{ .points = 12 } },
|
||||||
) },
|
) },
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
var r: CodepointResolver = .{ .collection = c };
|
var r: CodepointResolver = .{ .collection = c };
|
||||||
defer r.deinit(alloc);
|
defer r.deinit(alloc);
|
||||||
@ -429,7 +432,7 @@ test getIndex {
|
|||||||
{
|
{
|
||||||
const idx = r.getIndex(alloc, 0x270C, .regular, .text).?;
|
const idx = r.getIndex(alloc, 0x270C, .regular, .text).?;
|
||||||
try testing.expectEqual(Style.regular, idx.style);
|
try testing.expectEqual(Style.regular, idx.style);
|
||||||
const text_idx = if (font.options.backend == .coretext) 1 else 2;
|
const text_idx = if (comptime font.options.backend.hasCoretext()) 1 else 2;
|
||||||
try testing.expectEqual(@as(Collection.Index.IndexInt, text_idx), idx.idx);
|
try testing.expectEqual(@as(Collection.Index.IndexInt, text_idx), idx.idx);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -233,7 +233,7 @@ fn collection(
|
|||||||
// people add other emoji fonts to their system, we always want to
|
// people add other emoji fonts to their system, we always want to
|
||||||
// prefer the official one. Users can override this by explicitly
|
// prefer the official one. Users can override this by explicitly
|
||||||
// specifying a font-family for emoji.
|
// specifying a font-family for emoji.
|
||||||
if (comptime builtin.target.isDarwin()) apple_emoji: {
|
if (comptime builtin.target.isDarwin() and Discover != void) apple_emoji: {
|
||||||
const disco = try self.discover() orelse break :apple_emoji;
|
const disco = try self.discover() orelse break :apple_emoji;
|
||||||
var disco_it = try disco.discover(self.alloc, .{
|
var disco_it = try disco.discover(self.alloc, .{
|
||||||
.family = "Apple Color Emoji",
|
.family = "Apple Color Emoji",
|
||||||
|
@ -1213,7 +1213,7 @@ fn testShaperWithFont(alloc: Allocator, font_req: TestFont) !TestShaper {
|
|||||||
.{ .size = .{ .points = 12 } },
|
.{ .size = .{ .points = 12 } },
|
||||||
) });
|
) });
|
||||||
|
|
||||||
if (font.options.backend != .coretext) {
|
if (comptime !font.options.backend.hasCoretext()) {
|
||||||
// Coretext doesn't support Noto's format
|
// Coretext doesn't support Noto's format
|
||||||
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
||||||
lib,
|
lib,
|
||||||
|
Reference in New Issue
Block a user