A GitHub action that sets up an environment for proto and moon.
- Installs
protoglobally so that installed tools can also be executed globally. - Conditionally installs
moonglobally if the repository is using moon (attempts to detect a.moondirectory), ormoon-versionis set. - Caches the toolchain (
~/.proto) so subsequent runs are faster. - Hashes
.prototoolsand.moon/toolchain.ymlfiles to generate a unique cache key. - Cleans the toolchain before caching to remove unused or stale tools.
# ... jobs: ci: name: CI runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: moonrepo/setup-toolchain@v0 with: auto-install: true - run: moon ciauto-install- Auto-install proto tools by runningproto install. Defaults tofalse.auto-setup- Auto-setup moon toolchains by runningmoon setup. Defaults tofalse.cache- Toggle caching of the toolchain directory. Defaults totrue.cache-base- Base branch/ref to save a warmup cache on. Other branches/refs will restore from this base.cache-version- Version of the cache. Can be used to invalidate keys.moon-version- Version of moon to explicitly install. Version will be extracted from.prototools.proto-version- Version of proto to explicitly install. Version will be extracted from.moon/toolchain.yml.workspace-root- Relative path to moon's workspace root if initialized in a sub-directory. Defaults to "".