Skip to content

Commit

Permalink
Update build-pipeline.md for .storages cache mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed Nov 11, 2024
1 parent 8750153 commit ad5a600
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Sources/scipio/scipio.docc/build-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,29 @@ You can specify it by a second argument of `.storage` cache mode.
`producer` is an actor who attempt to save cache to the cache storage.

When build artifacts are built, then it try to save them.

### Use multiple cache storages at the same time

You can also use the `.storages` cache mode, which accepts multiple cache storages with different sets of cache actors:

```swift
import ScipioS3Storage

let s3Storage: some CacheStorage = ScipioS3Storage.S3Storage(config: ...)
let runner = Runner(
mode: .prepareDependencies,
options: .init(
baseBuildOptions: .init(
buildConfiguration: .release,
isSimulatorSupported: true
),
cacheMode: .storages([
(s3Storage, [.consumer] as Set),
(LocalCacheStorage(), [.producer, .consumer] as Set),
])
)
)
```

In the sample above, if some frameworks' caches are not found on `s3Storage`, those are tried to be fetched from the next `LocalCacheStorage()` then. The frameworks not found on `LocalCacheStorage` will be built and cached into it (since the storage is tied to `.producer` actor as well).

0 comments on commit ad5a600

Please sign in to comment.