Skip to content

Commit a725463

Browse files
Readme update (#16)
* readme * test config fix * example config
1 parent 297120e commit a725463

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/build-cargo.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
endpointUrl = "http://localhost:9000"
5252
bucketName = "forklift"
5353
useSSL = false
54+
[cache.extraMetadata]
55+
github_run_id="$GITHUB_RUN_ID"
56+
github_job="$GITHUB_JOB"
5457
'
5558
5659
- name: Checkout cargo 1

README.MD

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Forklift acts as a `rustc` wrapper and decides whether to use the cache based on
2626

2727
3. The wrapper gathers dependencies (`--extern name=path`) and forwards them to the server to verify if any of these dependencies have been rebuilt during this "session".
2828

29-
4. The wrapper computes the cache key from the `rustc` arguments (which already include the cargo hash), the output path, the hash of the source files, and the hash of the dependencies' artifacts.
29+
4. The wrapper computes the cache key from the `rustc` arguments (which already include the cargo hash), the output path, the hash of the source files, hash of the rustc binary, and the hash of the 'dependencies' artifacts.
3030

3131
5. **If there are any rebuilt dependencies** or the cache package is not present in the storage, Forklift will execute the specified `rustc` command, collect its output, and upload it to the server.
3232

@@ -91,9 +91,10 @@ See `forklift config --help` for more info.
9191
#### cache
9292
`[cache]`
9393

94-
| key | type | description |
95-
|----------|----------|------------------------------------------------------------------|
96-
| extraEnv | []string | Additional environment variable names for cache key calculations |
94+
| key | type | description |
95+
|---------------|-------------------|------------------------------------------------------------------|
96+
| extraEnv | []string | Additional environment variable names for cache key calculations |
97+
| extraMetadata | map[string]string | Additional fields to include in artifact metadata. If the value starts with a dollar sign ($), Forklift will attempt to resolve the environment variable during upload. |
9798

9899
#### storage
99100
`[storage]`

config-example.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ threadscount = 10
66
[cache]
77
extraEnv = ["SOME_VAR"]
88

9+
[cache.extraMetadata]
10+
github_run_id="$GITHUB_RUN_ID"
11+
github_job="$GITHUB_JOB"
12+
913
[compression]
1014
type = "zstd"
1115

0 commit comments

Comments
 (0)