Skip to content

Commit

Permalink
CI: Add build and fmt job
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Aug 3, 2024
1 parent fa5e836 commit 4ad6838
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and test library

on: [pull_request, push]

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0
- run: zig build test --summary all
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0
- run: zig fmt --check .
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
zig-cache/
zig-out/
zig-out/
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
// Once all dependencies are fetched, `zig build` no longer requires
// internet connectivity.
.dependencies = .{ },
.dependencies = .{},

// Specifies the set of files and directories that are included in this package.
// Only files and directories listed here are included in the `hash` that
Expand Down
4 changes: 4 additions & 0 deletions src/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ pub fn write(writer: anytype, data: anytype) !void {
@compileError("Serializing '" ++ @typeName(T) ++ "' is unsupported.");
}

test {
std.testing.refAllDecls(@This());
}

test "borsh: serialize and deserialize" {
var buffer = std.ArrayList(u8).init(testing.allocator);
defer buffer.deinit();
Expand Down

0 comments on commit 4ad6838

Please sign in to comment.