Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
/ place-ci-cd-demo Public archive

A demonstration of a Place CI/CD flow using Rojo and the Open Cloud Luau Execution API

License

Notifications You must be signed in to change notification settings

Roblox/place-ci-cd-demo

Repository files navigation

Roblox place, sample CI/CD setup

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 screenshot of the CI/CD steps in sequence

A special thanks is given to the creators of Rojo, Selene and StyLua for creating such awesome tools.

How to setup

  1. Create a Test place separate from your production place that can be used for running your tests
  2. 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
  3. Save this API key as a GitHub Actions Secret named ROBLOX_API_KEY
  4. 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
  5. (Optional) add GitHub branch protection rules to validate the checks have been passed on PRs before they have been merged

Notes

  • 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.

About

A demonstration of a Place CI/CD flow using Rojo and the Open Cloud Luau Execution API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published