updated workflow file to kill all instances of node after test is run #29
Workflow file for this run
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
- issue-* | |
pull_request: | |
branches: | |
- main | |
- issue-* | |
jobs: | |
Build_and_Test: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install the dependencies | |
run: npm ci | |
- name: Build the app and run the tests | |
run: npm start && npx wait-on http://localhost:3004 & npm test | |
- name: stop all instances of node | |
run: killall node | |
- name: Test Report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
with: | |
name: Test Results | |
path: ${{ github.workspace }}/reports/test-results.json | |
reporter: 'mocha-json' | |