summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml19
-rw-r--r--build.zig143
2 files changed, 38 insertions, 124 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6a6093c..8d3162e 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -34,8 +34,6 @@ jobs:
34 steps: 34 steps:
35 - name: Checkout repository 35 - name: Checkout repository
36 uses: actions/checkout@v4 36 uses: actions/checkout@v4
37 with:
38 submodules: true
39 37
40 - name: Setup zig 38 - name: Setup zig
41 uses: goto-bus-stop/setup-zig@v2 39 uses: goto-bus-stop/setup-zig@v2
@@ -60,14 +58,21 @@ jobs:
60 if: ${{ matrix.os == 'ubuntu-latest' }} 58 if: ${{ matrix.os == 'ubuntu-latest' }}
61 run: zig build test -Dci=true -Din_memory=true --summary all -fqemu -fwine 59 run: zig build test -Dci=true -Din_memory=true --summary all -fqemu -fwine
62 - name: Run Tests in memory 60 - name: Run Tests in memory
63 if: ${{ matrix.os == 'macos-latest' }} 61 if: ${{ matrix.os != 'ubuntu-latest' }}
64 run: zig build test -Dci=true -Din_memory=true --summary all -frosetta
65 - name: Run Tests in memory
66 if: ${{ matrix.os == 'windows-latest' }}
67 run: zig build test -Dci=true -Din_memory=true --summary all 62 run: zig build test -Dci=true -Din_memory=true --summary all
68 63
64 test-loadable-extension:
65 runs-on: ubuntu-latest
66 steps:
67 - name: Checkout repository
68 uses: actions/checkout@v4
69
70 - name: Setup zig
71 uses: goto-bus-stop/setup-zig@v2
72 with:
73 version: master
74
69 - name: Build the example zigcrypto loadable extension 75 - name: Build the example zigcrypto loadable extension
70 run: zig build zigcrypto 76 run: zig build zigcrypto
71 - name: Test the zigcrypto loadable extension 77 - name: Test the zigcrypto loadable extension
72 if: ${{ matrix.os != 'windows-latest' }}
73 run: ./zig-out/bin/zigcrypto-test 78 run: ./zig-out/bin/zigcrypto-test
diff --git a/build.zig b/build.zig
index b0e67f0..454a968 100644
--- a/build.zig
+++ b/build.zig
@@ -44,7 +44,7 @@ const ci_targets = switch (builtin.target.cpu.arch) {
44 TestTarget{ .query = .{ .cpu_arch = .x86, .abi = .gnu }, .bundled = true }, 44 TestTarget{ .query = .{ .cpu_arch = .x86, .abi = .gnu }, .bundled = true },
45 }, 45 },
46 .macos => [_]TestTarget{ 46 .macos => [_]TestTarget{
47 TestTarget{ .query = .{ .cpu_arch = .aarch64 }, .bundled = true }, 47 TestTarget{ .query = .{ .cpu_arch = .x86_64 }, .bundled = true },
48 }, 48 },
49 else => unreachable, 49 else => unreachable,
50 }, 50 },
@@ -54,134 +54,43 @@ const ci_targets = switch (builtin.target.cpu.arch) {
54const all_test_targets = switch (builtin.target.cpu.arch) { 54const all_test_targets = switch (builtin.target.cpu.arch) {
55 .x86_64 => switch (builtin.target.os.tag) { 55 .x86_64 => switch (builtin.target.os.tag) {
56 .linux => [_]TestTarget{ 56 .linux => [_]TestTarget{
57 // Targets linux but other CPU archs. 57 TestTarget{ .query = .{}, .bundled = false },
58 TestTarget{ 58 TestTarget{ .query = .{ .cpu_arch = .x86_64, .abi = .musl }, .bundled = true },
59 .query = .{}, 59 TestTarget{ .query = .{ .cpu_arch = .x86, .abi = .musl }, .bundled = true },
60 .bundled = false, 60 TestTarget{ .query = .{ .cpu_arch = .aarch64, .abi = .musl }, .bundled = true },
61 }, 61 TestTarget{ .query = .{ .cpu_arch = .riscv64, .abi = .musl }, .bundled = true },
62 TestTarget{ 62 TestTarget{ .query = .{ .cpu_arch = .mips, .abi = .musl }, .bundled = true },
63 .query = .{ 63 TestTarget{ .query = .{ .cpu_arch = .x86_64, .os_tag = .windows }, .bundled = true },
64 .cpu_arch = .x86_64, 64 TestTarget{ .query = .{ .cpu_arch = .x86, .os_tag = .windows }, .bundled = true },
65 .abi = .musl, 65 TestTarget{ .query = .{ .cpu_arch = .x86_64, .os_tag = .macos }, .bundled = true },
66 }, 66 TestTarget{ .query = .{ .cpu_arch = .aarch64, .os_tag = .macos }, .bundled = true },
67 .bundled = true,
68 },
69 TestTarget{
70 .query = .{
71 .cpu_arch = .x86,
72 .abi = .musl,
73 },
74 .bundled = true,
75 },
76 TestTarget{
77 .query = .{
78 .cpu_arch = .aarch64,
79 .abi = .musl,
80 },
81 .bundled = true,
82 },
83 TestTarget{
84 .query = .{
85 .cpu_arch = .riscv64,
86 .abi = .musl,
87 },
88 .bundled = true,
89 },
90 TestTarget{
91 .query = .{
92 .cpu_arch = .mips,
93 .abi = .musl,
94 },
95 .bundled = true,
96 },
97 // TODO(vincent): failing for some time for unknown reasons
98 // TestTarget{
99 // .query =.{
100 // .cpu_arch = .arm,
101 // .abi = .musleabihf,
102 // },
103 // .bundled = true,
104 // },
105 // Targets windows
106 TestTarget{
107 .query = .{
108 .cpu_arch = .x86_64,
109 .os_tag = .windows,
110 },
111 .bundled = true,
112 },
113 TestTarget{
114 .query = .{
115 .cpu_arch = .x86,
116 .os_tag = .windows,
117 },
118 .bundled = true,
119 },
120 // Targets macOS
121 TestTarget{
122 .query = .{
123 .cpu_arch = .x86_64,
124 .os_tag = .macos,
125 },
126 .bundled = true,
127 },
128 TestTarget{
129 .query = .{
130 .cpu_arch = .aarch64,
131 .os_tag = .macos,
132 },
133 .bundled = true,
134 },
135 }, 67 },
136 .windows => [_]TestTarget{ 68 .windows => [_]TestTarget{
137 TestTarget{ 69 TestTarget{ .query = .{ .cpu_arch = .x86_64, .abi = .gnu }, .bundled = true },
138 .query = .{ 70 TestTarget{ .query = .{ .cpu_arch = .x86, .abi = .gnu }, .bundled = true },
139 .cpu_arch = .x86_64,
140 .abi = .gnu,
141 },
142 .bundled = true,
143 },
144 TestTarget{
145 .query = .{
146 .cpu_arch = .x86,
147 .abi = .gnu,
148 },
149 .bundled = true,
150 },
151 }, 71 },
152 .freebsd => [_]TestTarget{ 72 .freebsd => [_]TestTarget{
153 TestTarget{ 73 TestTarget{ .query = .{}, .bundled = false },
154 .query = .{}, 74 TestTarget{ .query = .{ .cpu_arch = .x86_64 }, .bundled = true },
155 .bundled = false,
156 },
157 TestTarget{
158 .query = .{
159 .cpu_arch = .x86_64,
160 },
161 .bundled = true,
162 },
163 }, 75 },
164 .macos => [_]TestTarget{ 76 .macos => [_]TestTarget{
165 TestTarget{ 77 TestTarget{ .query = .{ .cpu_arch = .x86_64 }, .bundled = true },
166 .query = .{
167 .cpu_arch = .x86_64,
168 },
169 .bundled = true,
170 },
171 }, 78 },
172 else => [_]TestTarget{ 79 else => [_]TestTarget{
173 TestTarget{ 80 TestTarget{ .query = .{}, .bundled = false },
174 .query = .{},
175 .bundled = false,
176 },
177 }, 81 },
178 }, 82 },
179 else => [_]TestTarget{ 83 .aarch64 => switch (builtin.target.os.tag) {
180 TestTarget{ 84 .linux, .windows, .freebsd, .macos => [_]TestTarget{
181 .query = .{}, 85 TestTarget{ .query = .{}, .bundled = true },
182 .bundled = false, 86 },
87 else => [_]TestTarget{
88 TestTarget{ .query = .{}, .bundled = false },
183 }, 89 },
184 }, 90 },
91 else => [_]TestTarget{
92 TestTarget{ .query = .{}, .bundled = false },
93 },
185}; 94};
186 95
187fn computeTestTargets(isNative: bool, ci: ?bool) ?[]const TestTarget { 96fn computeTestTargets(isNative: bool, ci: ?bool) ?[]const TestTarget {