@rharkor/caching-for-turbo 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -60
- package/dist/cli/index.js +290 -75
- package/dist/cli/index.js.map +1 -1
- package/dist/setup/index.js +165 -24
- package/dist/setup/index.js.map +1 -1
- package/package.json +2 -62
- package/.env.example +0 -10
- package/action.yml +0 -61
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ the following step **before** you run `turbo build`:
|
|
|
55
55
|
|
|
56
56
|
```yaml
|
|
57
57
|
- name: Cache for Turbo
|
|
58
|
-
uses: rharkor/caching-for-turbo@v2.
|
|
58
|
+
uses: rharkor/caching-for-turbo@v2.1.1
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
This GitHub Action facilitates:
|
|
@@ -69,16 +69,16 @@ This GitHub Action facilitates:
|
|
|
69
69
|
|
|
70
70
|
## Local Development
|
|
71
71
|
|
|
72
|
-
You can also use this package as a
|
|
73
|
-
during development. This allows you to use the same caching
|
|
74
|
-
(including S3) that you use in CI.
|
|
72
|
+
You can also use this package as a global dependency to run the cache server
|
|
73
|
+
locally during development. This allows you to use the same caching
|
|
74
|
+
infrastructure (including S3) that you use in CI.
|
|
75
75
|
|
|
76
76
|
### Installation
|
|
77
77
|
|
|
78
|
-
Add this package as a
|
|
78
|
+
Add this package as a global dependency:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
npm install
|
|
81
|
+
npm install -g @rharkor/caching-for-turbo
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
### Usage
|
|
@@ -88,22 +88,22 @@ server:
|
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
# Start the server in background mode (recommended for development)
|
|
91
|
-
|
|
91
|
+
turbogha start
|
|
92
92
|
|
|
93
93
|
# Or run the server in foreground mode
|
|
94
|
-
|
|
94
|
+
turbogha start --foreground
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
To stop the server, you can use the following command:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
|
|
100
|
+
turbogha kill
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
To ping the server, you can use the following command:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
|
|
106
|
+
turbogha ping
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
### Environment Configuration
|
|
@@ -115,11 +115,11 @@ Create a `.env` file in your project root to configure the cache server:
|
|
|
115
115
|
PROVIDER=s3
|
|
116
116
|
|
|
117
117
|
# S3 Configuration (required when using s3 provider)
|
|
118
|
-
S3_ACCESS_KEY_ID
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
AWS_ACCESS_KEY_ID=secret # Or S3_ACCESS_KEY_ID
|
|
119
|
+
AWS_SECRET_ACCESS_KEY=secret # Or S3_SECRET_ACCESS_KEY
|
|
120
|
+
AWS_REGION=us-east-1 # Or AWS_DEFAULT_REGION or S3_REGION
|
|
121
|
+
AWS_ENDPOINT_URL_S3=https://s3.amazonaws.com # Or AWS_ENDPOINT_URL or S3_ENDPOINT
|
|
122
|
+
S3_BUCKET=my-bucket
|
|
123
123
|
S3_PREFIX=turbogha/
|
|
124
124
|
|
|
125
125
|
# Optional: Custom cache prefix
|
|
@@ -140,7 +140,6 @@ export TURBO_TEAM=turbogha
|
|
|
140
140
|
turbo build
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
_**Note:** Store the environment variables in a .env for turbo to use them._
|
|
144
143
|
_See: https://turborepo.com/docs/reference/system-environment-variables_
|
|
145
144
|
|
|
146
145
|
### Stopping the Server
|
|
@@ -148,41 +147,11 @@ _See: https://turborepo.com/docs/reference/system-environment-variables_
|
|
|
148
147
|
To stop the cache server:
|
|
149
148
|
|
|
150
149
|
```bash
|
|
150
|
+
turbogha kill
|
|
151
|
+
# or
|
|
151
152
|
curl -X DELETE http://localhost:41230/shutdown
|
|
152
153
|
```
|
|
153
154
|
|
|
154
|
-
### Development Workflow Example
|
|
155
|
-
|
|
156
|
-
1. **Start the cache server:**
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
npx turbogha
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
2. **Set up environment variables:**
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
export TURBO_API=http://localhost:41230
|
|
166
|
-
export TURBO_TOKEN=turbogha
|
|
167
|
-
export TURBO_TEAM=turbogha
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
3. **Run your builds with remote caching:**
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
turbo build
|
|
174
|
-
turbo test
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
4. **Stop the server when done:**
|
|
178
|
-
```bash
|
|
179
|
-
curl -X DELETE http://localhost:41230/shutdown
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
This setup allows you to use the same S3-based caching infrastructure locally
|
|
183
|
-
that you use in your CI pipeline, ensuring consistent caching behavior across
|
|
184
|
-
environments.
|
|
185
|
-
|
|
186
155
|
## Configurable Options
|
|
187
156
|
|
|
188
157
|
Customize the caching behavior with the following optional settings (defaults
|
|
@@ -193,7 +162,7 @@ with:
|
|
|
193
162
|
cache-prefix: turbogha_ # Custom prefix for cache keys
|
|
194
163
|
provider: github # Storage provider: 'github' (default) or 's3'
|
|
195
164
|
|
|
196
|
-
# S3 Provider Configuration (
|
|
165
|
+
# S3 Provider Configuration (variables will be read from environment variables if not provided)
|
|
197
166
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }} # S3 access key
|
|
198
167
|
s3-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }} # S3 secret key
|
|
199
168
|
s3-bucket: your-bucket-name # S3 bucket name
|
|
@@ -231,14 +200,10 @@ Example S3 configuration:
|
|
|
231
200
|
|
|
232
201
|
```yaml
|
|
233
202
|
- name: Cache for Turbo
|
|
234
|
-
uses: rharkor/caching-for-turbo@v2.
|
|
203
|
+
uses: rharkor/caching-for-turbo@v2.1.1
|
|
235
204
|
with:
|
|
236
205
|
provider: s3
|
|
237
|
-
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
|
|
238
|
-
s3-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
|
|
239
206
|
s3-bucket: my-turbo-cache-bucket
|
|
240
|
-
s3-region: us-west-2
|
|
241
|
-
s3-endpoint: https://s3.amazonaws.com
|
|
242
207
|
```
|
|
243
208
|
|
|
244
209
|
### Cache Cleanup Options
|
|
@@ -269,14 +234,10 @@ Example with cleanup configuration:
|
|
|
269
234
|
|
|
270
235
|
```yaml
|
|
271
236
|
- name: Cache for Turbo
|
|
272
|
-
uses: rharkor/caching-for-turbo@v2.
|
|
237
|
+
uses: rharkor/caching-for-turbo@v2.1.1
|
|
273
238
|
with:
|
|
274
239
|
provider: s3
|
|
275
|
-
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
|
|
276
|
-
s3-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
|
|
277
240
|
s3-bucket: my-turbo-cache-bucket
|
|
278
|
-
s3-region: us-west-2
|
|
279
|
-
s3-endpoint: https://s3.amazonaws.com
|
|
280
241
|
# Cleanup configuration
|
|
281
242
|
max-age: 2w
|
|
282
243
|
max-size: 5gb
|
|
@@ -314,4 +275,3 @@ file.
|
|
|
314
275
|
This project is inspired by
|
|
315
276
|
[dtinth](https://github.com/dtinth/setup-github-actions-caching-for-turbo) and
|
|
316
277
|
has been comprehensively rewritten for enhanced robustness and reliability.
|
|
317
|
-
|