Update README.md #184
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: Node Js | |
on: [push] | |
jobs: | |
build-frontend: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Run npm build | |
working-directory: frontend/public | |
run: | | |
npm install react-scripts | |
npm run build | |
run-backend: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Start the backend server | |
working-directory: backend | |
run: | | |
npm install cors --save | |
node server.js | |
pid=$(lsof -i :8080 -t) | |
kill -9 $pid || true | |
run-tests: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Run tests | |
working-directory: "frontend/src/" | |
run: | | |
npm install react-scripts | |
npm install jest | |
npm test "frontend/src/AppTest.test.js" |