Nextjs 앱에서 Github Actions를 사용하여 Cypress에서 e2e 테스트를 실행하기위한 매우 간단한 구성이 있습니다. npm start
명령에 도달하면 올바른 출력을 제공하기 때문에 작동하는 것처럼 보이지만 > Ready on http://localhost:3000
다음 단계로 진행하지 않고 단계가 보류 상태로 유지됩니다.
이 문제를 해결하는 방법에 대한 제안 사항이 있습니까?
다음 github 작업 구성 ( .github/workflows/nodejs.yml
) :
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm start
npx wait-on http://localhost:3000
env:
CI: true
- name: Run Cypress
run: |
npx cypress run
env:
CI: true
제어 연산자를 사용하면 &
효과적입니다. 다음을 시도하십시오.
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm start & npx wait-on http://localhost:3000
env:
CI: true
에서 사람 강타
제어 연산자 &에 의해 명령이 종료되면 쉘은 서브 쉘의 백그라운드에서 명령을 실행합니다. 쉘은 명령이 완료 될 때까지 기다리지 않으며 리턴 상태는 0입니다.이를 비동기 명령이라고합니다. 로 구분 된 명령; 순차적으로 실행됩니다. 쉘은 각 명령이 차례로 종료되기를 기다립니다. 반환 상태는 마지막으로 실행 된 명령의 종료 상태입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다