Skip to content

feat: add examples/ and CI - #2

Merged
itsakeyfut merged 2 commits into
mainfrom
feat/examples-and-ci
Jul 22, 2026
Merged

feat: add examples/ and CI#2
itsakeyfut merged 2 commits into
mainfrom
feat/examples-and-ci

Conversation

@itsakeyfut

Copy link
Copy Markdown
Owner

Summary

Move the demo out of src/main.zig into a dedicated examples/ directory and add GitHub Actions CI, mirroring the slotmap repository layout.

Changes

  • Remove src/main.zig; add examples/basic.zig (single-fiber run/yield/resume walkthrough) and examples/scheduler.zig (round-robin cooperative scheduling over several fibers)
  • Wire a zig build examples step that builds and runs every example, and include examples/ in the package paths
  • Add .github/workflows/ci.yml running zig build and zig build test on Zig 0.16.0
  • Point the README at examples/ and add a CI badge

Notes

  • The CI matrix is ubuntu-latest and windows-latest only. macOS is intentionally omitted: the context switch is x86_64-only and GitHub's macOS runners are ARM64, so a macOS job cannot compile fiber.

Test Plan

  • zig build compiles cleanly
  • zig build test passes
  • zig fmt --check . passes
  • zig build examples runs both examples successfully

Replace the single src/main.zig demo with a dedicated examples/ directory
that both demonstrates the API and doubles as living documentation, mirroring
the slotmap repository layout.

- Remove src/main.zig
- Add examples/basic.zig: single-fiber run/yield/resume walkthrough
- Add examples/scheduler.zig: round-robin cooperative scheduling over several
  fibers, showing the building-block use case
- Wire a `zig build examples` step that builds and runs every example
- Include examples/ in the package paths and point the README at it
Run zig build and zig build test on every push and pull request to main.

- Matrix over ubuntu-latest and windows-latest on Zig 0.16.0
- Omit macOS: the context switch is x86_64-only and GitHub macOS runners
  are ARM64
- Add a CI status badge to the README
@itsakeyfut itsakeyfut self-assigned this Jul 22, 2026
@itsakeyfut
itsakeyfut merged commit a3cacfe into main Jul 22, 2026
2 checks passed
@itsakeyfut
itsakeyfut deleted the feat/examples-and-ci branch July 22, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant