Skip to content

Update workflow github actions #12

Update workflow github actions

Update workflow github actions #12

Workflow file for this run

name: Run Backend Unit Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
backend-unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Clear npm cache
run: |
npm cache clean --force
- name: Install dependencies
run: |
cd backend
npm install
- name: Run tests
run: |
cd backend
npm run test
- name: Display coverage directory contents
run: |
cd backend
ls -R coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./backend/coverage/*.json,./backend/coverage/lcov.info,./backend/coverage/clover.xml
flags: backend
fail_ci_if_error: true