File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ workflow_dispatch :
4+
5+ permissions :
6+ pages : write
7+ id-token : write
8+
9+ jobs :
10+ autodocs :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v3
14+ - uses : mlugg/setup-zig@v1
15+ with :
16+ version : 0.15.1
17+ - run : |
18+ zig build-lib -femit-docs src/root.zig
19+ mv docs _site
20+ - name : Upload artifact
21+ uses : actions/upload-pages-artifact@v3
22+
23+ test :
24+ runs-on : ubuntu-latest
25+ steps :
26+ - uses : actions/checkout@v3
27+ - uses : mlugg/setup-zig@v1
28+ with :
29+ version : 0.15.1
30+ - run : zig build test --summary all
31+
32+ deploy :
33+ environment :
34+ name : github-pages
35+ url : ${{ steps.deployment.outputs.page_url }}
36+ runs-on : ubuntu-latest
37+ needs :
38+ - autodocs
39+ - test
40+ steps :
41+ - name : Deploy to GitHub Pages
42+ id : deployment
43+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -2,23 +2,21 @@ const std = @import("std");
22
33pub fn build (b : * std.Build ) void {
44 const target = b .standardTargetOptions (.{});
5- const optimize = b .standardOptimizeOption (.{});
65
7- _ = b .addModule ("zigqlite" , .{
8- .root_source_file = b .path ("src/sqlite .zig" ),
6+ const mod = b .addModule ("zigqlite" , .{
7+ .root_source_file = b .path ("src/root .zig" ),
98 .target = target ,
10- .optimize = optimize ,
119 });
1210
13- const main_tests = b .addTest (.{
14- .root_source_file = b .path ("src/sqlite.zig" ),
15- .target = target ,
16- .optimize = optimize ,
11+ const mod_tests = b .addTest (.{
12+ .root_module = mod ,
1713 });
18- main_tests .linkSystemLibrary ("c" );
19- main_tests .linkSystemLibrary ("sqlite3" );
2014
21- const test_step = b .step ("test" , "Run library tests" );
22- const run_main_tests = b .addRunArtifact (main_tests );
23- test_step .dependOn (& run_main_tests .step );
15+ mod_tests .linkSystemLibrary ("c" );
16+ mod_tests .linkSystemLibrary ("sqlite3" );
17+
18+ const run_mod_tests = b .addRunArtifact (mod_tests );
19+
20+ const test_step = b .step ("test" , "Run tests" );
21+ test_step .dependOn (& run_mod_tests .step );
2422}
You can’t perform that action at this time.
0 commit comments