From 9fd8effba678fc1b290bf97c61936cb93980df3d Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 02:23:16 -0800 Subject: [PATCH 01/10] Add .woodpecker.yml --- .woodpecker.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..e66d171 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,6 @@ +pipeline: + unit-tests: + image: alpine + commands: + - apk add sqlite + - zig build unit From 19585a295dc0ef63708c4d0865e3e42cb4891953 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 02:57:26 -0800 Subject: [PATCH 02/10] skip lfs --- .woodpecker.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index e66d171..be61aa8 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,3 +1,10 @@ +clone: + git: + image: woodpeckerci/plugin-git + settings: + depth: 1 + lfs: false + pipeline: unit-tests: image: alpine From 4f96e752a8bf3cf428530e01af45c0c29ce6ecd7 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 03:59:31 -0800 Subject: [PATCH 03/10] dependencies --- .woodpecker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index be61aa8..27dd3bc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,5 +9,6 @@ pipeline: unit-tests: image: alpine commands: - - apk add sqlite - - zig build unit + - apk add sqlite sqlite-dev libpq libpq-dev curl xz + - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + - ./zig-linux-x86_64-0.10.0/zig build unit From 08eec536a00fb66158233faf26db22835c0665e1 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:11:34 -0800 Subject: [PATCH 04/10] Testing a passing test --- .woodpecker.yml | 2 +- src/template/lib.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 27dd3bc..c6c1ab2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -11,4 +11,4 @@ pipeline: commands: - apk add sqlite sqlite-dev libpq libpq-dev curl xz - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x - - ./zig-linux-x86_64-0.10.0/zig build unit + - ./zig-linux-x86_64-0.10.0/zig build unit:template diff --git a/src/template/lib.zig b/src/template/lib.zig index 4698cab..78b8cb8 100644 --- a/src/template/lib.zig +++ b/src/template/lib.zig @@ -1349,7 +1349,7 @@ test "template" { try testCase("", .{}, ""); try testCase("abcd", .{}, "abcd"); - try testCase("{.val}", .{ .val = 3 }, "3"); + try testCase("{.v}", .{ .v = @as(usize, 3) }, "3"); try testCase("{#if .val}1{/if}", .{ .val = true }, "1"); try testCase("{#for .vals |$v|=} {$v} {=/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); try testCase("{#for .vals |$val|}{$val}{/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); From 64bdf1c48ac4c27e6f998c13769bf899de66fb05 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:12:26 -0800 Subject: [PATCH 05/10] testing a failing test --- src/template/lib.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/template/lib.zig b/src/template/lib.zig index 78b8cb8..4f2691e 100644 --- a/src/template/lib.zig +++ b/src/template/lib.zig @@ -1349,7 +1349,7 @@ test "template" { try testCase("", .{}, ""); try testCase("abcd", .{}, "abcd"); - try testCase("{.v}", .{ .v = @as(usize, 3) }, "3"); + try testCase("{.v}", .{ .v = @as(usize, 3) }, "4"); try testCase("{#if .val}1{/if}", .{ .val = true }, "1"); try testCase("{#for .vals |$v|=} {$v} {=/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); try testCase("{#for .vals |$val|}{$val}{/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); From 7e6110fbfed0c8b3717dd331af234d9df281680d Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:44:56 -0800 Subject: [PATCH 06/10] Setup unit test CI --- .woodpecker.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..27dd3bc --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,14 @@ +clone: + git: + image: woodpeckerci/plugin-git + settings: + depth: 1 + lfs: false + +pipeline: + unit-tests: + image: alpine + commands: + - apk add sqlite sqlite-dev libpq libpq-dev curl xz + - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + - ./zig-linux-x86_64-0.10.0/zig build unit From cac2b014c59a4fd7f2e122794b1464acbccf1e7c Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:46:55 -0800 Subject: [PATCH 07/10] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0f326b..c1ff375 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Untitled Social Network server +# fediglam +[![status-badge](https://ci.heartles.xyz/api/badges/heartles/fediglam/status.svg)](https://ci.heartles.xyz/heartles/fediglam) +A (soon to be federated) social networking server ## Building ### Requirements From 469df7bfcd57c5c6f31c413f30acfcd991d6e049 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:51:23 -0800 Subject: [PATCH 08/10] Zig fmt --- src/http/urlencode.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/urlencode.zig b/src/http/urlencode.zig index bd97f50..fdfb680 100644 --- a/src/http/urlencode.zig +++ b/src/http/urlencode.zig @@ -68,7 +68,7 @@ pub const Iter = struct { /// + pub fn parse([]const u8) !F /// /// Boolean Parameters: -/// The following query strings will all parse a `true` value for the +/// The following query strings will all parse a `true` value for the /// parameter `foo: bool = false`: /// - `?foo` /// - `?foo=true` From 6900c77a3202a5aacc9405b3c96267214d1cc87b Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:54:25 -0800 Subject: [PATCH 09/10] Add zig fmt step --- .woodpecker.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 27dd3bc..fea78e9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,6 +6,11 @@ clone: lfs: false pipeline: + fmt: + image: alpine + - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + - ./zig-linux-x86_64-0.10.0/zig fmt --check src/ tests/ build.zig + unit-tests: image: alpine commands: From 10f3f33048e9eb2230635d8eedf3514d1fa73bf4 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 05:01:55 -0800 Subject: [PATCH 10/10] Download zig binary once --- .woodpecker.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index fea78e9..1ad7b69 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,14 +6,22 @@ clone: lfs: false pipeline: - fmt: + zig-compiler: image: alpine + - echo "Downloading dependencies..." + - apk add curl xz + - echo "Downloading zig binary..." - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + + format: + image: alpine + - echo "Checking formatting..." - ./zig-linux-x86_64-0.10.0/zig fmt --check src/ tests/ build.zig unit-tests: image: alpine commands: - - apk add sqlite sqlite-dev libpq libpq-dev curl xz - - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + - echo "Downloading dependencies..." + - apk add sqlite sqlite-dev libpq libpq-dev + - echo "Running unit tests..." - ./zig-linux-x86_64-0.10.0/zig build unit