Skip to content

Commit

Permalink
ci: add zig 0.11.0 (#62)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
goto-bus-stop and chenrui333 authored Dec 30, 2023
1 parent c7b6cdd commit 8dab702
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0]
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0]
include:
- os: ubuntu-latest
zig-version: 0.5.0
Expand All @@ -30,6 +30,11 @@ jobs:
uses: goto-bus-stop/setup-zig@default
with:
version: ${{matrix.zig-version}}
- name: Run tests
- name: Run tests (zig up to v0.10.x)
if: ${{ !startsWith(matrix.zig-version, '0.11.') }}
run: zig build test
working-directory: test/v0.10
- name: Run tests (zig v0.11.x)
if: ${{ startsWith(matrix.zig-version, '0.11.') }}
run: zig build test
working-directory: test
working-directory: test/v0.11
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions test/v0.11/build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Build = @import("std").Build;

pub fn build(b: *Build) void {
const optimize = b.standardOptimizeOption(.{});
const test_build = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.optimize = optimize,
});
const run_test = b.addRunArtifact(test_build);

const test_step = b.step("test", "Run the app");
test_step.dependOn(&run_test.step);
}
5 changes: 5 additions & 0 deletions test/v0.11/src/main.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const debug = @import("std").debug;

test "it works" {
debug.assert(1 == 1);
}

0 comments on commit 8dab702

Please sign in to comment.