From 3d969fb3314d2ed42bfb1206b5588a023513a494 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sat, 28 Oct 2023 09:33:42 -0700 Subject: [PATCH] add sample test/update build to show all configurations should work --- .gitea/workflows/build.yaml | 7 +++++-- build.zig.zon | 4 ++-- src/main.zig | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6227e93..af902ae 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -21,8 +21,11 @@ jobs: - run: wget -q https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz - run: tar x -C /usr/local -f zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz - run: ln -s /usr/local/zig-linux-${ARCH}-${ZIG_VERSION}/zig /usr/local/bin/zig - - run: zig build - - run: zig build -Dtarget=arm-linux # we want to know we can build for 32 bit + - run: zig build + - run: zig build -Dtarget=arm-linux # we want to know we can build for 32 bit + - run: zig build -Dtarget=wasm32-wasi # Cloudflare requires wasm + - run: zig build -Dtarget=aarch64-linux-musl # AWS Lambda uses this + - run: zig build test - name: Notify uses: https://git.lerch.org/lobo/action-notify-ntfy@v2 if: always() diff --git a/build.zig.zon b/build.zig.zon index 1335f02..dcaf5e1 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -4,8 +4,8 @@ .dependencies = .{ .universal_lambda_build = .{ - .url = "https://git.lerch.org/lobo/universal-lambda-zig/archive/5376b6a725d406b0b9581eb65505a852730d6a98.tar.gz", - .hash = "1220fb872507639f1d42f11a50f33dbdc0343a888c6592892a38ba210e6e0ae6285c", + .url = "https://git.lerch.org/lobo/universal-lambda-zig/archive/07366606696081f324591b66ab7a9a176a38424c.tar.gz", + .hash = "122049daa19f61d778a79ffb82c64775ca5132ee5c4797d7f7d76667ab82593917cd", }, .flexilib = .{ .url = "https://git.lerch.org/lobo/flexilib/archive/3d3dab9c792651477932e2b61c9f4794ac694dcb.tar.gz", diff --git a/src/main.zig b/src/main.zig index 020ea38..5c2f2c9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -19,3 +19,7 @@ fn handler(allocator: std.mem.Allocator, event_data: []const u8, context: interf try writer.print("Event data passed to handler: {s}\n", .{event_data}); return al.items; } + +test "simple test" { + try std.testing.expectEqual(@as(usize, 4), 2 + 2); +}