Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8d3aea7
add build steps and options constants
Torbatti Mar 13, 2025
777877e
add Example enum and toString helper function
Torbatti Mar 13, 2025
e571fa9
add run build step
Torbatti Mar 13, 2025
770f5f1
add example build option
Torbatti Mar 13, 2025
904764e
add build example module function
Torbatti Mar 13, 2025
3b06dcc
add link libc for examples built for windows targets
Torbatti Mar 13, 2025
d44d368
add build example exe function
Torbatti Mar 13, 2025
552c0b1
fix mismatched types
Torbatti Mar 13, 2025
2df53eb
forbid running when example name enum is set to all
Torbatti Mar 13, 2025
1a82b7d
build examples function implemented
Torbatti Mar 13, 2025
43b9c23
removed the old add_example codes
Torbatti Mar 13, 2025
e693727
add comments for the sake of clearification
Torbatti Mar 13, 2025
53cf8b9
update: build example ported to the new syntax
Torbatti Mar 13, 2025
a2043af
documentation for building and running example folder
Torbatti Mar 13, 2025
ca08bca
changed comments mentioning zig run to zig build run
Torbatti Mar 13, 2025
4e50218
fixed depending on 2 similiar install steps
Torbatti Mar 14, 2025
2d622b0
add static step
Torbatti Mar 14, 2025
a269a34
ported general unit tests step
Torbatti Mar 14, 2025
a66565a
ported e2e tests
Torbatti Mar 14, 2025
19bc5d5
add formatter tests / zig build test will run unit test and fmt tests
Torbatti Mar 14, 2025
13aed47
added more info / fixed typos / removed todo comments
Torbatti Mar 14, 2025
9610961
part 1 of fixing pr
Torbatti Mar 16, 2025
631a255
fixed readme
Torbatti Mar 16, 2025
cd25fa2
fixed info logging on every loop
Torbatti Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
version: 0.14.0
- name: Build Examples
run: zig build
run: zig build -Dexample=all
- name: Run unit tests
run: zig build test --summary all

Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,31 @@ const tardy = b.dependency("tardy", .{
.optimize = optimize,
}).module("tardy");

exe.root_module.addImport(tardy);
exe_mod.addImport("tardy", tardy);
```

## Example
## Building and running example folder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building and Running Examples

- NOTE: by default build/install step uses `-Dexample=none` , meaning it wont build any examples

- List available examples
```sh
zig build --help
```

- Build/run a specific example
```sh
zig build -Dexample=[nameOfExample]
```
```sh
zig build run -Dexample=[nameOfExample]
```

- Build all examples
```sh
zig build -Dexample=all
```

## TCP Example
A basic multi-threaded TCP echo server.

```zig
Expand Down
Loading