feat: add examples/ and CI - #2
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the demo out of
src/main.ziginto a dedicatedexamples/directory and add GitHub Actions CI, mirroring the slotmap repository layout.Changes
src/main.zig; addexamples/basic.zig(single-fiber run/yield/resume walkthrough) andexamples/scheduler.zig(round-robin cooperative scheduling over several fibers)zig build examplesstep that builds and runs every example, and includeexamples/in the package paths.github/workflows/ci.ymlrunningzig buildandzig build teston Zig 0.16.0examples/and add a CI badgeNotes
ubuntu-latestandwindows-latestonly. 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 buildcompiles cleanlyzig build testpasseszig fmt --check .passeszig build examplesruns both examples successfully