diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2203973 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Build +on: + push: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ + linux-latest, + windows-latest, + macos-latest, + ] + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v1.3.0 + with: + version: master + + - name: Build and Unit Test + run: zig build test -Doptimize=ReleaseSmall diff --git a/build.zig b/build.zig index b9f2803..dacb224 100644 --- a/build.zig +++ b/build.zig @@ -2,7 +2,7 @@ const std = @import("std"); const Builder = std.build.Builder; const Pkg = std.build.Pkg; const comptimePrint = std.fmt.comptimePrint; -const FileSource = std.build.FileSource; +const LazyPath = std.build.LazyPath; const microzig = @import("microzig"); @@ -17,7 +17,7 @@ pub const BuildOptions = struct { pub const PicoExecutableOptions = struct { name: []const u8, - source_file: FileSource, + source_file: LazyPath, optimize: std.builtin.OptimizeMode = .Debug, }; @@ -52,7 +52,7 @@ pub fn build(b: *Builder) !void { }, .optimize = optimize, }); - pio_tests.addIncludePath("src/hal/pio/assembler"); + pio_tests.addIncludePath(.{ .path = "src/hal/pio/assembler" }); const test_step = b.step("test", "run unit tests"); test_step.dependOn(&b.addRunArtifact(pio_tests).step); diff --git a/build.zig.zon b/build.zig.zon index d8db2db..28bea9e 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.0.0", .dependencies = .{ .microzig = .{ - .url = "https://github.com/ZigEmbeddedGroup/microzig/archive/9392fe0f7bddde26155c181ab80b70097b49c791.tar.gz", - .hash = "1220326148075cd017425e04356329c33c3e794d31a54bdafa46521fcfcc55b422a3", + .url = "https://github.com/ZigEmbeddedGroup/microzig/archive/d4a48f65fac24dcfe789d217a9154086b6a011e5.tar.gz", + .hash = "1220fd3ad4f6a88f111791cb80de1fc388d0a51114ab376f2bf8351cd176747fa303", }, .args = .{ .url = "https://github.com/MasterQ32/zig-args/archive/91d1e89fb89a4d01dec7c9aec95b0a324080ebcc.tar.gz",