我有这个 Gitlab-ci.yml 文件
.react_cache:
stage: cache
image: registry.gitlab.com/path to my docker image
script:
- cd react-app
- npm install -g yarn
- yarn
- yarn install --frozen-lockfile --no-progress
cache:
key:
files:
- react-app/yarn.lock
Playwright_Test:
stage: test
# only:
# changes:
# - "./react-app/**/*"
image: registry.gitlab.com/path to my other docker image
script:
- cd laravel
- cp .env.testing .env
- composer install
- php artisan key:generate
- php artisan serve --port=80 &
- cd ../react-app/
- npx playwright install
- npx playwright test ../react-app/tests/**/*.spec.ts
services:
- name: mcr.microsoft.com/playwright:bionic
alias: playwright
dependencies:
- .react_cache
在上面,当管道运行时,会出现此错误
Playwright_Test job: undefined dependency: .react_cache
我的另一个问题是,当我只使用更改子句时,它应该在反应的任何文件夹内发生更改时运行,但它不会运行我在这里做错了什么
提前感谢您的帮助
我尝试了上面提到的但没有成功