Skip to content

Commit

Permalink
Fix fts5 (without vendoring) (#41)
Browse files Browse the repository at this point in the history
* In updating build.zig I have forgotten that we need FTS support

- Let's add a test that we can successfully initialise database in GitHub Action (will fail initially)

* Try again

* Revendor zig-sqlite

* Reremove vendored zig-sqlite

* Use zig master again

* Use latest zig-sqlite that allows enabling fts5 without vendoring

* Update url

* Also run tests on change to build.zig.zon
  • Loading branch information
malcolmstill authored Jun 23, 2024
1 parent a909024 commit 8468e29
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.13.0
version: master
- run: echo -n $GITHUB_REF_NAME > src/.version
- run: zig build
- run: echo "zig-out/bin" >> $GITHUB_PATH
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.13.0
version: master
- run: echo -n $GITHUB_REF_NAME > src/.version
- run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.target }}-${{ matrix.os }}
- uses: actions/upload-artifact@v3
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- src/**
- lib/**
- build.zig
- build.zig.zon
- .github/workflows/test.yaml

jobs:
Expand All @@ -18,13 +19,22 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.13.0
version: master
- run: zig build -Dtarget=${{ matrix.target }}-${{ matrix.os }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: master
- run: zig build
- run: zig-out/bin/clerk
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.13.0
version: master
- run: zig fmt --check src/*.zig
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub fn build(b: *std.Build) void {
const sqlite = b.dependency("sqlite", .{
.target = target,
.optimize = optimize,
.fts5 = true,
});

const @"ansi-term" = b.dependency("ansi-term", .{
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.version = "0.0.0",
.dependencies = .{
.sqlite = .{
.url = "https://github.com/vrischmann/zig-sqlite/archive/91e5fedd15c5ea3cb42ccceefb3d0f4bb9bad68f.tar.gz",
.hash = "1220ba277845cb3cece7a7a1f929b920c97e9085bb644471c5dc8c72571f1485c75f",
.url = "https://github.com/vrischmann/zig-sqlite/archive/878f8cf92b308dabe2dce9e24bd7849e005f7ab5.tar.gz",
.hash = "1220a3ff3c8e2a41fe0fe73e795e0eee4c3882edceef8ef16b0b250c7895709a9192",
},
.@"ansi-term" = .{
// ansi-term not yet on zig-0.13.0
Expand Down

0 comments on commit 8468e29

Please sign in to comment.