Skip to content

Commit 8dab702

Browse files
ci: add zig 0.11.0 (#62)
* chore(ci): add 0.11.0 Signed-off-by: Rui Chen <[email protected]> * Support zig 0.11 build system --------- Signed-off-by: Rui Chen <[email protected]> Co-authored-by: Rui Chen <[email protected]>
1 parent c7b6cdd commit 8dab702

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-latest, macos-latest, windows-latest]
21-
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0]
21+
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0]
2222
include:
2323
- os: ubuntu-latest
2424
zig-version: 0.5.0
@@ -30,6 +30,11 @@ jobs:
3030
uses: goto-bus-stop/setup-zig@default
3131
with:
3232
version: ${{matrix.zig-version}}
33-
- name: Run tests
33+
- name: Run tests (zig up to v0.10.x)
34+
if: ${{ !startsWith(matrix.zig-version, '0.11.') }}
35+
run: zig build test
36+
working-directory: test/v0.10
37+
- name: Run tests (zig v0.11.x)
38+
if: ${{ startsWith(matrix.zig-version, '0.11.') }}
3439
run: zig build test
35-
working-directory: test
40+
working-directory: test/v0.11
File renamed without changes.
File renamed without changes.

test/v0.11/build.zig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const Build = @import("std").Build;
2+
3+
pub fn build(b: *Build) void {
4+
const optimize = b.standardOptimizeOption(.{});
5+
const test_build = b.addTest(.{
6+
.root_source_file = .{ .path = "src/main.zig" },
7+
.optimize = optimize,
8+
});
9+
const run_test = b.addRunArtifact(test_build);
10+
11+
const test_step = b.step("test", "Run the app");
12+
test_step.dependOn(&run_test.step);
13+
}

test/v0.11/src/main.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const debug = @import("std").debug;
2+
3+
test "it works" {
4+
debug.assert(1 == 1);
5+
}

0 commit comments

Comments
 (0)