gpt4 book ai didi

ubuntu - 在 github actions ubuntu-latest 上收到 "Cache not found for input keys: cache-playwright-linux-1.20.0"

转载 作者:行者123 更新时间:2023-12-05 03:27:17 26 4
gpt4 key购买 nike

我遵循中提供的示例 https://playwrightsolutions.com/playwright-github-action-to-cache-the/

在我的 yml 文件中有以下代码

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x

然后我只编辑这里的版本以匹配当前版本

- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: cache-playwright-linux-1.20.0

然后我跑

- name: Install dependencies
run: npm ci
- name: Install Playwright
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test

我收到“找不到输入键的缓存:cache-playwright-linux-1.20.0”

最佳答案

您可以使用 os 和 package-lock.json 文件改进缓存键。 key 的后半部分可能比首选更改更多,但适用于许多构建。

- uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'

https://justin.poehnelt.com/posts/caching-playwright-in-github-actions/

关于ubuntu - 在 github actions ubuntu-latest 上收到 "Cache not found for input keys: cache-playwright-linux-1.20.0",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71527147/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com