Create services.service.spec.ts #4
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: Run tests and upload coverage | |
on: | |
push: | |
paths: | |
- 'backend/**' | |
pull_request: | |
paths: | |
- 'backend/**' | |
jobs: | |
test: | |
name: Run backend tests and collect coverage | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
cache-dependency-path: './backend/package.json' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test -- --coverage | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./backend/coverage | |
flags: backend | |
fail_ci_if_error: true |