Skip to content

Commit

Permalink
feat: allow placing start commands on separate lines (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov authored Feb 23, 2021
1 parent 691998c commit 224f894
Show file tree
Hide file tree
Showing 6 changed files with 37,875 additions and 39,892 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/example-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,41 @@ jobs:
build: npm run build
start: npm start
wait-on: 'http://localhost:5000'

start-multiple:
# example with web application build
# and several services to start
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cypress tests
uses: ./
with:
working-directory: examples/start
build: npm run build
# single start command per line
start: |
npm start
npm run start2
wait-on: 'http://localhost:8000'
config: 'baseUrl=http://localhost:8000'

start-multiple-commas:
# example with web application build
# and several services to start
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cypress tests
uses: ./
with:
working-directory: examples/start
build: npm run build
# use commas to separate the commands
start: npm start, npm run start2
wait-on: 'http://localhost:8000'
config: 'baseUrl=http://localhost:8000'
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,17 @@ jobs:
start: npm run api, npm run web
```

You can place the start commands in separate lines

```yml
with:
start: |
npm run api
npm run web
```

[![start example](https://github.com/cypress-io/github-action/workflows/example-start/badge.svg?branch=master)](.github/workflows/example-start.yml)

### 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.
Expand Down
Loading

0 comments on commit 224f894

Please sign in to comment.