Warning
This is a sample project intended to demonstrate how the new Open Cloud Luau execution API can be used. It has not been battle tested so creators should proceed with caution when adapting it for their own experiences.
This repository is an example of a place CI/CD setup for fully managed Rojo projects.
It includes:
- Linting with Selene
- Validating code format with StyLua
- Running tests by building a RBXL with Rojo, uploading to Roblox, then executing Luau using the Engine Open Cloud API for Executing Luau
- Deployment using Rojo
A special thanks is given to the creators of Rojo, Selene and StyLua for creating such awesome tools.
- Create a Test place separate from your production place that can be used for running your tests
- Generate an Open Cloud API key with the following permissions for both your test place and your production place.
universe.places:write
universe.place.luau-execution-session:write
- Save this API key as a GitHub Actions Secret named
ROBLOX_API_KEY
- Create GitHub Actions Repository Variables for the following values
ROBLOX_PRODUCTION_UNIVERSE_ID
,ROBLOX_PRODUCTION_PLACE_ID
ROBLOX_TEST_UNIVERSE_ID
,ROBLOX_TEST_PLACE_ID
- (Optional) add GitHub branch protection rules to validate the checks have been passed on PRs before they have been merged
- The CI/CD steps are implemented in .github/workflows/cicd.yml, which in turn calls the python and shell scripts in /scripts
- The implementation assumes you have a branch called
production
that all commits to are deployed, and all PRs to have checks run - This implementation assumes you have a fully managed Rojo workflow. The automated testing would theoretically work on a partially managed Rojo workflow (provided your test did not reference non Rojo managed Instances) but deployment will not.
- The python wrappers for Open Cloud inside /scripts/python were written for this demonstration and are not intended as clients for general use
- The Engine Open Cloud API for Executing Luau is currently limited to two concurrent request per universe. The GitHub actions config in this example accounts for this by creating a concurrency group. This will prevent Luau execution jobs from attempting to run concurrently and failing.
- Note, we aim to lift this limit in the future.
- An example PR is given showing CI checks failing: example
- Because the CI/CD pipeline requires an Open Cloud API key to run, more work is required for use in Open Source projects where fork maintainers will have to create these places, variables and API keys themselves for checks to run correctly on their forks.