Skip to content

Commit

Permalink
biscuit/ + workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmstill committed Oct 1, 2023
1 parent 2000b6d commit e7bcd3c
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/main.zig → biscuit/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit e7bcd3c

Please sign in to comment.