ci: adds shared reusable setup polytest and mock server actions#18
Merged
aorumbayev merged 11 commits intoalgorandfoundation:mainfrom Dec 8, 2025
Merged
Conversation
* fix: handles binary msgpack responses correctly Ensures correct handling of binary msgpack responses by using `arrayBuffer()` instead of `text()` to prevent UTF-8 corruption. Also adds logging for content type and binary status, and adjusts the response preview logic to only apply to non msgpack data. * chore: cd for image publishing
aorumbayev
commented
Dec 2, 2025
PatrickDinh
approved these changes
Dec 5, 2025
aorumbayev
commented
Dec 8, 2025
Introduces a composite GitHub Action to simplify starting mock servers for testing Algorand API clients (algod, indexer, kmd). This action handles installing Bun, mock-server dependencies, starting the server in the background, waiting for the server to be healthy, and exporting environment variables for use in subsequent steps. It uses the mock-server located in the `resources/mock-server/` directory of this repo and makes it available as a reusable action.
There was a problem hiding this comment.
Pull request overview
This PR enhances the AlgoKit Polytest repository by adding CI/CD infrastructure for easier integration with downstream projects. The changes provide reusable GitHub Actions for setting up polytest and running mock servers, along with improved local development scripts.
Key Changes:
- Introduces composite GitHub Actions (
setup-polytestandrun-mock-server) for standardized CI integration - Replaces Docker-based server startup with Bun-native shell scripts for better performance and flexibility
- Significantly expands documentation with usage examples, environment variable conventions, and integration guides
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
.github/actions/setup-polytest/action.yml |
New composite action to install Rust toolchain and polytest CLI with optional version pinning |
.github/actions/run-mock-server/action.yml |
New composite action to start mock servers in CI with health checks and environment variable exports |
.github/actions/run-mock-server/README.md |
Comprehensive documentation for the run-mock-server action with multiple usage examples |
resources/mock-server/scripts/start_server.sh |
Refactored from Docker to Bun-native execution with improved argument validation and error handling |
resources/mock-server/scripts/start_all_servers.sh |
New script to start all three mock servers concurrently with health checks and logging |
resources/mock-server/scripts/stop_all_servers.sh |
New utility script to cleanly stop all running mock servers |
resources/mock-server/README.md |
Expanded with detailed usage instructions, environment variables, and troubleshooting guidance |
README.md |
Complete rewrite providing repository overview, GitHub Actions documentation, and integration examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
562e5ba to
2c0ff3d
Compare
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.
Adds shared GitHub Actions for setting up polytest and running mock servers, enhances the mock server to handle binary responses correctly, and removes unused endpoints.
Changes
setup-polytestaction: Composite action for installing Rust and the polytest CLI, allowing version specification and reuse from ts and py utilsrun-mock-serveraction: Composite action that starts mock servers using Bun directly (no Docker required), with automatic health checks and environment variable exports (MOCK_ALGOD_URL,MOCK_INDEXER_URL,MOCK_KMD_URL)start_all_servers.sh,start_server.sh,stop_all_servers.sh) for local developmentUsage
See run-mock-server README for full documentation.
Validation
Validated behavior tested against utils-py - see pr description in algorandfoundation/algokit-utils-py#231
Validated behavior tested against utils-ts - see pr description in algorandfoundation/algokit-utils-ts#477