Skip to content

chore: readme for collab and history #276

chore: readme for collab and history

chore: readme for collab and history #276

Workflow file for this run

name: Run tests and upload coverage
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
service:
# Add one entry per microservice
- name: leetcode-backend
context: ./backend-services/leetcode-backend-service
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm install
working-directory: ${{ matrix.service.context }}
- name: Run tests with coverage
working-directory: ${{ matrix.service.context }}
run: |
mkdir -p test-results
npm run test:ci
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ matrix.service.context }}/test-results/junit.xml
flags: ${{ matrix.service.name }}
name: ${{ matrix.service.name }} tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: |
${{ matrix.service.context }}/coverage/lcov.info
flags: ${{ matrix.service.name }}
fail_ci_if_error: true