我想在 Azure Pipelines 中缓存 Swift 包管理器

问题描述 投票:0回答:1

参考下页创建任务 https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops

- task: Cache@2
inputs:
    key: '"spm" | "$(Agent.OS)" | Package.resolved'
    restoreKeys: |
    spm | "$(Agent.OS)"

该文件存在于以下路径

$(Pipeline.Workspace)/{project}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

我收到错误消息,提示找不到文件。

##[error]System.IO.FileNotFoundException: File not found: Package.resolved

我该怎么做?

swift caching azure-pipelines swift-package-manager
1个回答
0
投票

我弄清楚了如何在 Azure 中缓存 SPM,基本上使用此存储库中建议的内容:

https://github.com/Niccari/azure-pipeline-spm-caching/blob/main/azure-pipeline.yaml

无论如何,如果你使用的是微软云主机,缓存检索确实很慢。例如,我们有 1200 MB 的缓存,有时需要 8~10 分钟才能检索整个内容。使用缓存并没有真正的改进,在我们的例子中,速度会变慢。

© www.soinside.com 2019 - 2024. All rights reserved.