Skip to content

Test react app with wait-on #16

Test react app with wait-on

Test react app with wait-on #16

name: Test react app with wait-on
on: workflow_dispatch
jobs:
standard:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
steps:
- name: checkout
uses: actions/checkout@v3
- name: install Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: dependencies
run: npm ci
- name: start server
run: npm start &
- name: netstat
run: netstat -lnt | grep 3000
- name: curl
run: npm run curl
- name: check server is running
run: npx wait-on http://localhost:3000 -t 15000 -v
workaround-1:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
steps:
- name: checkout
uses: actions/checkout@v3
- name: install Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: dependencies
run: npm ci
- name: start server
run: npm start &
- name: netstat
run: netstat -lnt | grep 3000
- name: curl
run: npm run curl
- name: check server is running
run: npx wait-on http://127.0.0.1:3000 -t 15000 -v
workaround-2:
runs-on: ubuntu-22.04
env:
HOST: 0.0.0.0
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
steps:
- name: checkout
uses: actions/checkout@v3
- name: install Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: dependencies
run: npm ci
- name: start server
run: npm start &
- name: netstat
run: netstat -lnt | grep 3000
- name: curl
run: npm run curl
- name: check server is running
run: npx wait-on http://localhost:3000 -t 15000 -v