Skip to content

Commit

Permalink
Add CI build job
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyley committed Aug 18, 2023
1 parent 9b6af64 commit 221b33c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI Build

on:
push:
jobs:
Build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
mode: [ Debug, ReleaseSafe, ReleaseSmall ]
target: [ native, x86_64-linux-gnu, x86_64-linux-musl, aarch64-linux-gnu, x86_64-macos, aarch64-macos, x86_64-windows, aarch64-windows ]
name: ${{ matrix.os }}, ${{ matrix.target }}-${{ matrix.mode }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
name: Checkout repo

- name: Install Zig
uses: goto-bus-stop/setup-zig@v2

- name: Build
run: zig build -Doptimize=${{ matrix.mode }} -Dtarget=${{ matrix.target }}

- name: Upload
if: matrix.os == 'ubuntu-latest' && matrix.target != 'native' && matrix.mode == 'ReleaseSmall'
uses: actions/upload-artifact@v3
with:
path: zig-out/bin
name: ${{ matrix.target }} - ${{ matrix.mode }}
3 changes: 0 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ pub fn build(b: *std.Build) void {
b.installArtifact(exe);

const run_cmd = b.addRunArtifact(exe);

run_cmd.step.dependOn(b.getInstallStep());

if (b.args) |args| {
run_cmd.addArgs(args);
}

const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}

0 comments on commit 221b33c

Please sign in to comment.