Test react app with wait-on #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, 21] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- 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, 21] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- 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, 21] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- 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 |