diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a40c011 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: biscuit tests +on: push + +jobs: + unit-tests: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v1 + with: + version: master + - run: zig build test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v1 + with: + version: master + - run: zig fmt --check src/*.zig + build-compiler: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v1 + with: + version: master + - run: zig build diff --git a/src/main.zig b/biscuit/src/main.zig similarity index 68% rename from src/main.zig rename to biscuit/src/main.zig index f656329..7bf91ec 100644 --- a/src/main.zig +++ b/biscuit/src/main.zig @@ -7,6 +7,6 @@ export fn add(a: i32, b: i32) i32 { test { _ = @import("biscuit-format"); - _ = @import("token/block.zig"); - _ = @import("token/biscuit.zig"); + _ = @import("biscuit-schema"); + _ = @import("biscuit-datalog"); } diff --git a/src/token/authorizer.zig b/biscuit/src/token/authorizer.zig similarity index 100% rename from src/token/authorizer.zig rename to biscuit/src/token/authorizer.zig diff --git a/src/token/biscuit.zig b/biscuit/src/token/biscuit.zig similarity index 100% rename from src/token/biscuit.zig rename to biscuit/src/token/biscuit.zig diff --git a/src/token/block.zig b/biscuit/src/token/block.zig similarity index 100% rename from src/token/block.zig rename to biscuit/src/token/block.zig diff --git a/src/token/builder/fact.zig b/biscuit/src/token/builder/fact.zig similarity index 100% rename from src/token/builder/fact.zig rename to biscuit/src/token/builder/fact.zig diff --git a/build.zig b/build.zig index 5391999..a0acf3f 100644 --- a/build.zig +++ b/build.zig @@ -19,7 +19,7 @@ pub fn build(b: *std.Build) void { .name = "biscuit", // In this case the main source file is merely a path, however, in more // complicated build scripts, this could be a generated file. - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = .{ .path = "biscuit/src/main.zig" }, .target = target, .optimize = optimize, }); @@ -76,7 +76,7 @@ pub fn build(b: *std.Build) void { // Creates a step for unit testing. This only builds the test executable // but does not run it. const main_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = .{ .path = "biscuit/src/main.zig" }, .target = target, .optimize = optimize, });