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 8c7c16e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 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,30 @@ 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 localCacheStorage: some CacheStorage = LocalCacheStorage()
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 8c7c16e

Please sign in to comment.