Skip to content

Commit

Permalink
Add CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed Mar 27, 2024
1 parent 6ef0c35 commit 230026d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build

on:
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install -y sqlite3

- uses: actions/checkout@v4

- uses: goto-bus-stop/setup-zig@v2
with:
version: master

- run: zig build test --summary all
6 changes: 6 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ pub fn build(b: *std.Build) !void {
},
});
}

const tests = b.addTest(.{ .root_source_file = .{ .path = "src/main.zig" } });
tests.root_module.link_objects = sqlite.link_objects;
const run_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&run_tests.step);
}
6 changes: 6 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const std = @import("std");

pub const SQLite3 = @import("sqlite.zig").SQLite3;
pub const Pool = @import("pool.zig").Pool;
pub const Session = @import("session.zig").Session;
Expand All @@ -9,3 +11,7 @@ pub const update = @import("dsl.zig").update;
pub const delete = @import("dsl.zig").delete;

pub const migrate = @import("migrate.zig").migrate;

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

0 comments on commit 230026d

Please sign in to comment.