Skip to content

Commit

Permalink
fix CI: disable macos native job for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Ji committed Nov 17, 2024
1 parent b4e223a commit 363c0c4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ jobs:
- name: Build and run tests
run: zig build test
- name: Build examples
run: zig build -Dskipexamples=particle_life,intersection_2d examples
run: zig build -Dskip=particle_life,intersection_2d examples

build-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Install sdl2
run: brew install sdl2
- name: Build and run tests
run: zig build test
- name: Build examples
run: zig build examples
# build-macos:
# runs-on: macos-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Read .zig-version
# id: zigversion
# uses: juliangruber/read-file-action@v1
# with:
# path: ./.zigversion
# - name: Install Zig
# uses: mlugg/setup-zig@v1
# with:
# version: ${{ steps.zigversion.outputs.content }}
# - name: Install sdl2
# run: brew install sdl2
# - name: Build and run tests
# run: zig build test
# - name: Build examples
# run: zig build examples

build-windows:
strategy:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
}
write-mode: overwrite
- name: Build examples
run: zig build -Dtarget=x86_64-windows-gnu -Dskipexamples=particle_life examples
run: zig build -Dtarget=x86_64-windows-gnu -Dskip=particle_life examples

build-cross-linux:
strategy:
Expand All @@ -192,4 +192,4 @@ jobs:
with:
version: ${{ steps.zigversion.outputs.content }}
- name: Build examples
run: zig build -Dtarget=${{matrix.target}} -Dskipexamples=particle_life examples
run: zig build -Dtarget=${{matrix.target}} -Dskip=particle_life examples
10 changes: 5 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pub fn build(b: *Build) void {
}

// Get skipped examples' names
var skipexamples = std.StringHashMap(bool).init(b.allocator);
var skiped_examples = std.StringHashMap(bool).init(b.allocator);
if (b.option(
[]const u8,
"skipexamples",
"skip given examples when building all. e.g. \"particle_life,intersection_2d\"",
"skip",
"skip given demos when building `examples`. e.g. \"particle_life,intersection_2d\"",
)) |s| {
var it = std.mem.splitScalar(u8, s, ',');
while (it.next()) |name| skipexamples.put(name, true) catch unreachable;
while (it.next()) |name| skiped_examples.put(name, true) catch unreachable;
}

const target = b.standardTargetOptions(.{});
Expand Down Expand Up @@ -90,7 +90,7 @@ pub fn build(b: *Build) void {
"compile & run example " ++ demo.name,
);
run_step.dependOn(&run_cmd.step);
if (skipexamples.get(demo.name) == null) {
if (skiped_examples.get(demo.name) == null) {
build_examples.dependOn(&install_cmd.step);
}
}
Expand Down

0 comments on commit 363c0c4

Please sign in to comment.