我遵循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
我收到“未找到输入键的缓存:高速缓存-剧作家-Linux-1.20.0”
2条答案
按热度按时间0vvn1miw1#
你可以通过使用os和package-lock.json文件来改进你的缓存键。键的后一部分可能会比你喜欢的修改得更多,但是对很多构建都有效。
https://justin.poehnelt.com/posts/caching-playwright-in-github-actions/
dldeef672#
这个策略对我很有效(有铬依赖):
结果:
。
的数据。
要查找更多信息,请参阅GitHub讨论https://github.com/microsoft/playwright/issues/7249