Skip to content

Commit

Permalink
fix: explicit exit on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Nov 13, 2019
1 parent 6f9164e commit bd4e21f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})


Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit bd4e21f

Please sign in to comment.