diff --git a/README.md b/README.md index 52d1b6b4d..cbb1154ba 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,26 @@ jobs: start: npm start ``` +**Note:** sometimes on Windows you need to run a different start command. You can use `start-windows` parameter for this + +```yml +name: With server +on: [push] +jobs: + cypress-run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Cypress run + uses: cypress-io/github-action@v1 + with: + # Linux and MacOS + start: npm start + # Takes precedences on Windows + start-windows: npm run start:windows:server +``` + ### Wait-on If you are starting a local server and it takes a while to start, you can add a parameter `wait-on` and pass url to wait for the server to respond. Uses [wait-on](https://www.npmjs.com/package/wait-on) under the hood. diff --git a/dist/index.js b/dist/index.js index 04813d4e2..c96bb7055 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1866,11 +1866,13 @@ Promise.all([restoreCachedNpm(), restoreCachedCypressBinary()]) console.log('all done, exiting') // force exit to avoid waiting for child processes, // like the server we have started + // see https://github.com/actions/toolkit/issues/216 process.exit(0) }) .catch(error => { console.log(error) core.setFailed(error.message) + process.exit(1) }) diff --git a/index.js b/index.js index 599ab4271..b2e29f598 100644 --- a/index.js +++ b/index.js @@ -263,9 +263,11 @@ Promise.all([restoreCachedNpm(), restoreCachedCypressBinary()]) console.log('all done, exiting') // force exit to avoid waiting for child processes, // like the server we have started + // see https://github.com/actions/toolkit/issues/216 process.exit(0) }) .catch(error => { console.log(error) core.setFailed(error.message) + process.exit(1) })