Skip to content

Commit 4a87da4

Browse files
authored
Merge pull request #63 from Mishieck/chore-use-zig-0.15.1
chore: use zig 0.15.1
2 parents a42a849 + c4e3132 commit 4a87da4

File tree

18 files changed

+552
-104
lines changed

18 files changed

+552
-104
lines changed

.github/workflows/spec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
name: Run CommonMark specs
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v6
1111
with:
1212
submodules: recursive
13-
- uses: goto-bus-stop/setup-zig@v2
13+
- uses: mlugg/setup-zig@v2
1414
with:
15-
version: 0.14.0
15+
version: 0.15.1
1616
- run: make spec

.github/workflows/zig.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,26 @@ on:
55
pull_request:
66

77
jobs:
8-
test-linux:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- uses: goto-bus-stop/setup-zig@v2
13-
with:
14-
version: 0.14.0
15-
- run: zig build
16-
- run: zig build test
17-
test-macos:
18-
runs-on: macos-latest
8+
tests:
9+
strategy:
10+
matrix:
11+
zig-version: ["0.15.1"]
12+
runs-on: ["ubuntu-latest", "macos-latest", "windows-latest"]
13+
runs-on: ${{ matrix.runs-on }}
1914
steps:
20-
- uses: actions/checkout@v4
21-
- uses: goto-bus-stop/setup-zig@2a9625d550eefc3a9b1a43d342ad655f563f8241
15+
- uses: actions/checkout@v6
16+
- uses: mlugg/setup-zig@v2
2217
with:
23-
version: 0.14.0
24-
- run: zig build
25-
- run: zig build test
26-
test-windows:
27-
runs-on: windows-latest
28-
steps:
29-
- uses: actions/checkout@v4
30-
- uses: goto-bus-stop/setup-zig@v2
31-
with:
32-
version: 0.14.0
18+
version: ${{ matrix.zig-version }}
3319
- run: zig build
3420
- run: zig build test
3521
lint:
3622
runs-on: ubuntu-latest
3723
steps:
38-
- uses: actions/checkout@v4
39-
- uses: goto-bus-stop/setup-zig@v2
24+
- uses: actions/checkout@v6
25+
with:
26+
submodules: recursive
27+
- uses: mlugg/setup-zig@v2
4028
with:
41-
version: 0.14.0
42-
- run: zig fmt --check src/*.zig
29+
version: 0.15.1
30+
- run: zig fmt --check build.zig src/*.zig

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
/result
44
# generated by htmlentities.zig
55
src/entities.zig
6+
7+
# example outputs
8+
examples/output-*

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ all:
44
test:
55
zig build test
66

7+
exe:
8+
echo hello | zig build run
9+
zig build run --help
10+
zig build run -- --help
11+
712
spec:
813
zig build
914
cd vendor/cmark-gfm/test && python3 spec_tests.py --program=../../../zig-out/bin/koino
15+
16+
fetch-clap:
17+
zig fetch --save https://github.com/Hejsil/zig-clap/archive/refs/tags/0.11.0.tar.gz
18+
19+
fetch-htmlentities:
20+
zig fetch --save git+https://nossa.ee/~talya/htmlentities.zig
21+
22+
fetch-libpcre:
23+
zig fetch --save git+https://github.com/kivikakk/libpcre.zig
24+
25+
fetch-zunicode:
26+
zig fetch --save git+https://github.com/mishieck/zunicode
27+
28+
example:
29+
zig build example

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,8 @@ Options:
8383

8484
Library:
8585

86-
Documentation is TODO — see [LoLa](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/src/tools/render-md-page.zig#L157) for an example of use. Note also the [`build.zig`](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/build.zig#L41-L50) declaration.
86+
Documentation is TODO — see:
87+
88+
- [LoLa](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/src/tools/render-md-page.zig#L157): for an example of use. Note also the [`build.zig`](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/build.zig#L41-L50) declaration.
89+
- [Markdown to HTML example](./examples/to-html.zig).
8790

build.zig

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ pub fn build(b: *std.Build) !void {
2525

2626
const exe = b.addExecutable(.{
2727
.name = "koino",
28-
.root_source_file = b.path("src/main.zig"),
29-
.target = target,
30-
.optimize = optimize,
28+
.root_module = b.createModule(.{
29+
.root_source_file = b.path("src/main.zig"),
30+
31+
.target = target,
32+
.optimize = optimize,
33+
34+
.imports = &.{
35+
.{ .name = "test_koino", .module = mod },
36+
},
37+
}),
3138
});
3239
try addCommonRequirements(exe.root_module, &deps);
3340
b.installArtifact(exe);
@@ -41,10 +48,39 @@ pub fn build(b: *std.Build) !void {
4148
run_cmd.addArgs(args);
4249
}
4350

51+
const example = b.addExecutable(.{
52+
.name = "koino_example",
53+
.root_module = b.createModule(.{
54+
.root_source_file = b.path("examples/to-html.zig"),
55+
56+
.target = target,
57+
.optimize = optimize,
58+
59+
.imports = &.{
60+
.{ .name = "test_koino", .module = mod },
61+
},
62+
}),
63+
});
64+
65+
try addCommonRequirements(example.root_module, &deps);
66+
b.installArtifact(example);
67+
68+
const example_run_cmd = b.addRunArtifact(example);
69+
example_run_cmd.step.dependOn(b.getInstallStep());
70+
const example_run_step = b.step("example", "Run example");
71+
example_run_step.dependOn(&example_run_cmd.step);
72+
4473
const test_exe = b.addTest(.{
45-
.root_source_file = b.path("src/main.zig"),
46-
.target = target,
47-
.optimize = optimize,
74+
.root_module = b.createModule(.{
75+
.root_source_file = b.path("src/main.zig"),
76+
77+
.target = target,
78+
.optimize = optimize,
79+
80+
.imports = &.{
81+
.{ .name = "test_koino", .module = mod },
82+
},
83+
}),
4884
});
4985
try addCommonRequirements(test_exe.root_module, &deps);
5086

build.zig.zon

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
.{
22
.name = .koino,
33
.version = "0.1.0",
4-
.minimum_zig_version = "0.14.0",
4+
.minimum_zig_version = "0.15.1",
55
.fingerprint = 0x2af09c5b5aeed24b,
66
.dependencies = .{
77
.zunicode = .{
8-
.url = "git+https://nossa.ee/~talya/zunicode#d5527c35892a1e448f65afd127f055251cd26b51",
9-
.hash = "zunicode-0.1.0-AAAAAAn0BQAjplm0OqOuLlE2kcI8p65nBybLoZwsjBrH",
8+
.url = "git+https://github.com/mishieck/zunicode#e765542e914737d313b4a56e946e5adb3d0544b9",
9+
.hash = "zunicode-0.1.0-Ftska3z0BQAecb-Fpt9JXeZJpTOX4ZPOLkTWS5DoUVsP",
1010
},
1111
.clap = .{
12-
.url = "git+https://github.com/Hejsil/zig-clap#a4e784da8399c51d5eeb5783e6a485b960d5c1f9",
13-
.hash = "clap-0.10.0-oBajB8fkAQB0JvsrWLar4YZrseSZ9irFxHB7Hvy_bvxb",
12+
.url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.11.0.tar.gz",
13+
.hash = "clap-0.11.0-oBajB-HnAQDPCKYzwF7rO3qDFwRcD39Q0DALlTSz5H7e",
1414
},
1515
.libpcre_zig = .{
16-
.url = "git+https://nossa.ee/~talya/libpcre.zig#04224f0bed09888d043c6fe4352458dbd907c815",
17-
.hash = "libpcre_zig-0.1.0-Dtf6CQg4AACWtDDhtI-rjGGLKdBowMQiQrK1O5sx5icv",
16+
.url = "git+https://github.com/kivikakk/libpcre.zig#3f61efd01ec45281c4bc6f8f6d0ae7b718e7056e",
17+
.hash = "libpcre_zig-0.1.0-Dtf6CQ04AACiOaA107r6fJ9BpThKZCzDeqp-v5Xv0Ixr",
1818
},
1919
.htmlentities_zig = .{
20-
.url = "git+https://nossa.ee/~talya/htmlentities.zig#1a49942505db7bd06770006f66b907bb3a088b9f",
21-
.hash = "htmlentities_zig-0.1.0-zV-DJCAfAwDQMPxoEXaBrDxijlyvCK7HXhz9MIgGYj5l",
20+
.url = "git+https://nossa.ee/~talya/htmlentities.zig#50cb7d848e81389c71fc383534ece76a3fc36284",
21+
.hash = "htmlentities_zig-0.1.0-zV-DJDYiAwAv5XJgsNlBPl79pWgiOkJ4-8OUgV95Ksb2",
2222
},
2323
},
2424

@@ -27,6 +27,7 @@
2727
"Makefile",
2828
"build.zig.zon",
2929
"src",
30+
"examples",
3031
"LICENSE",
3132
"README.md",
3233
},

0 commit comments

Comments
 (0)