Caching for Turborepo, using GitHub Actions’ cache service.
Add this to your GitHub Actions workflow, before running turbo build
.
- name: Cache for Turbo
uses: rharkor/caching-for-turbo@v1.2
The action will:
-
Launch a server on
localhost:41230
(and waits for it to be ready). -
Exports the
TURBO_API
,TURBO_TOKEN
andTURBO_TEAM
environment variables for use byturbo build
. -
Sets up a post-build step to print the server logs (for debugging).
Configuration is optional. Here are the available options and their default values:
with:
# Set the prefix for the cache keys.
cache-prefix: turbogha_
To run the tests:
Start a server in a separate terminal:
npm run dev-run
Run the tests:
npm test
This project is licensed under the MIT License - see the LICENSE file.
The code was inspired by dtinth but was entirely rewritten to be more robust.