Skip to content

Commit 3a8a0b6

Browse files
author
lite3-zig
committed
add act and vibe warning
1 parent 91fc64b commit 3a8a0b6

4 files changed

Lines changed: 156 additions & 38 deletions

File tree

.github/workflows/ci-local.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Local CI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Setup mise
13+
uses: jdx/mise-action@v3
14+
15+
- name: Install tools with mise
16+
run: mise install
17+
18+
- name: Check formatting
19+
run: mise exec -- zig fmt --check src/lite3.zig src/tests.zig src/bench.zig
20+
21+
test:
22+
strategy:
23+
matrix:
24+
optimize: [Debug, ReleaseSafe, ReleaseFast]
25+
json: [true, false]
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Setup mise
31+
uses: jdx/mise-action@v3
32+
33+
- name: Install tools with mise
34+
run: mise install
35+
36+
- name: Build
37+
run: mise exec -- zig build
38+
39+
- name: Test (${{ matrix.optimize }}, json=${{ matrix.json }})
40+
run: mise exec -- zig build test -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
41+
42+
- name: Build examples (${{ matrix.optimize }}, json=${{ matrix.json }})
43+
run: mise exec -- zig build examples -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
44+
45+
- name: Run examples (${{ matrix.optimize }}, json=${{ matrix.json }})
46+
run: |
47+
mise exec -- ./zig-out/bin/basic
48+
mise exec -- ./zig-out/bin/json_roundtrip
49+
50+
unsupported-options:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Setup mise
56+
uses: jdx/mise-action@v3
57+
58+
- name: Install tools with mise
59+
run: mise install
60+
61+
- name: Verify -Dlto=true fails with clear message
62+
run: |
63+
set +e
64+
output=$(mise exec -- zig build test -Dlto=true 2>&1)
65+
status=$?
66+
echo "$output"
67+
if [ "$status" -eq 0 ]; then
68+
echo "Expected -Dlto=true to fail."
69+
exit 1
70+
fi
71+
echo "$output" | grep -q "currently unsupported in lite3-zig"
72+
73+
cross-compile:
74+
runs-on: ubuntu-latest
75+
strategy:
76+
matrix:
77+
target:
78+
- aarch64-linux-gnu
79+
- x86_64-linux-gnu
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Setup mise
84+
uses: jdx/mise-action@v3
85+
86+
- name: Install tools with mise
87+
run: mise install
88+
89+
- name: Cross-compile (${{ matrix.target }})
90+
run: mise exec -- zig build -Dtarget=${{ matrix.target }}

.github/workflows/ci.yml

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ on:
66
pull_request:
77
branches: [main]
88

9-
jobs:
10-
format:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
15-
- uses: mlugg/setup-zig@v2
16-
with:
17-
version: 0.15.2
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup mise
16+
uses: jdx/mise-action@v3
17+
18+
- name: Install tools with mise
19+
run: mise install
1820

1921
- name: Check formatting
20-
run: zig fmt --check src/lite3.zig src/tests.zig src/bench.zig
22+
run: mise exec -- zig fmt --check src/lite3.zig src/tests.zig src/bench.zig
2123

2224
test:
2325
strategy:
@@ -29,37 +31,41 @@ jobs:
2931
steps:
3032
- uses: actions/checkout@v4
3133

32-
- uses: mlugg/setup-zig@v2
33-
with:
34-
version: 0.15.2
35-
34+
- name: Setup mise
35+
uses: jdx/mise-action@v3
36+
37+
- name: Install tools with mise
38+
run: mise install
39+
3640
- name: Build
37-
run: zig build
41+
run: mise exec -- zig build
3842

3943
- name: Test (${{ matrix.optimize }}, json=${{ matrix.json }})
40-
run: zig build test -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
44+
run: mise exec -- zig build test -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
4145

4246
- name: Build examples (${{ matrix.optimize }}, json=${{ matrix.json }})
43-
run: zig build examples -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
47+
run: mise exec -- zig build examples -Doptimize=${{ matrix.optimize }} -Djson=${{ matrix.json }}
4448

4549
- name: Run examples (${{ matrix.optimize }}, json=${{ matrix.json }})
4650
run: |
47-
./zig-out/bin/basic
48-
./zig-out/bin/json_roundtrip
51+
mise exec -- ./zig-out/bin/basic
52+
mise exec -- ./zig-out/bin/json_roundtrip
4953
5054
unsupported-options:
5155
runs-on: ubuntu-latest
5256
steps:
5357
- uses: actions/checkout@v4
5458

55-
- uses: mlugg/setup-zig@v2
56-
with:
57-
version: 0.15.2
59+
- name: Setup mise
60+
uses: jdx/mise-action@v3
61+
62+
- name: Install tools with mise
63+
run: mise install
5864

5965
- name: Verify -Dlto=true fails with clear message
6066
run: |
6167
set +e
62-
output=$(zig build test -Dlto=true 2>&1)
68+
output=$(mise exec -- zig build test -Dlto=true 2>&1)
6369
status=$?
6470
echo "$output"
6571
if [ "$status" -eq 0 ]; then
@@ -70,17 +76,19 @@ jobs:
7076
7177
cross-compile:
7278
runs-on: ubuntu-latest
73-
strategy:
74-
matrix:
75-
target:
76-
- aarch64-linux-gnu
77-
- x86_64-linux-gnu
78-
steps:
79-
- uses: actions/checkout@v4
80-
81-
- uses: mlugg/setup-zig@v2
82-
with:
83-
version: 0.15.2
84-
85-
- name: Cross-compile (${{ matrix.target }})
86-
run: zig build -Dtarget=${{ matrix.target }}
79+
strategy:
80+
matrix:
81+
target:
82+
- aarch64-linux-gnu
83+
- x86_64-linux-gnu
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Setup mise
88+
uses: jdx/mise-action@v3
89+
90+
- name: Install tools with mise
91+
run: mise install
92+
93+
- name: Cross-compile (${{ matrix.target }})
94+
run: mise exec -- zig build -Dtarget=${{ matrix.target }}

Justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ test-no-json:
2323
# Run all test variants
2424
test-all: test test-release test-fast test-no-json
2525

26+
# Run the local GitHub Actions CI workflow with act
27+
act-local:
28+
act -W .github/workflows/ci-local.yml
29+
2630
# Build example programs
2731
examples:
2832
zig build examples

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# lite3-zig
22

3-
Idiomatic [Zig](https://ziglang.org/) wrapper for [Lite³](https://github.com/fastserial/lite3), a JSON-compatible zero-copy serialization format that encodes data as a B-tree inside a single contiguous buffer, allowing O(log n) access and mutation on any arbitrary field.
3+
**WARNING: This library is fully vibe-coded; it's just for me for now. use at your own risk**
4+
5+
(Human's note: _aim's to be_) Idiomatic [Zig](https://ziglang.org/) wrapper for [Lite³](https://github.com/fastserial/lite3), a JSON-compatible zero-copy serialization format that encodes data as a B-tree inside a single contiguous buffer, allowing O(log n) access and mutation on any arbitrary field.
46

57
## Features
68

@@ -185,8 +187,22 @@ just test-release # Run tests with ReleaseSafe
185187
just test-no-json # Run tests with JSON backend disabled
186188
just clean # Remove build artifacts
187189
just update-vendor # Update vendored lite3 sources
190+
just act-local # Run local CI in act
191+
188192
```
189193

194+
### Local GitHub Actions (act)
195+
196+
To run CI locally, use the dedicated workflow in `.github/workflows/ci-local.yml`:
197+
198+
```bash
199+
act workflow_dispatch -W .github/workflows/ci-local.yml
200+
```
201+
202+
If you install act and want a short alias, use `just act-local` from the root of this repository.
203+
204+
The local workflow intentionally mirrors the existing CI commands on Linux so it can run in `act` consistently without requiring a macOS runner.
205+
190206
## Safety notes
191207

192208
### Dangling pointers

0 commit comments

Comments
 (0)