xiaoju-survey/.github/workflows/codecov.yml

40 lines
772 B
YAML
Raw Permalink Normal View History

2024-05-16 08:35:44 +00:00
# Unit Test Coverage Report
name: Test Coverage
on:
pull_request:
branches:
- feature/workflow
2024-05-16 10:09:29 +00:00
- develop
- main
- releases/**
- feature/**
2024-05-16 12:03:30 +00:00
paths:
2024-05-16 12:40:54 +00:00
- server/**
2024-05-16 08:35:44 +00:00
workflow_dispatch:
2024-05-16 07:20:48 +00:00
jobs:
2024-05-16 08:35:44 +00:00
build:
name: Coverage
2024-05-16 07:20:48 +00:00
runs-on: ubuntu-latest
2024-05-16 08:35:44 +00:00
2024-05-16 07:20:48 +00:00
steps:
- name: Checkout
uses: actions/checkout@v4
2024-05-16 08:35:44 +00:00
- name: Setup node
2024-05-16 10:09:29 +00:00
uses: actions/setup-node@v4
2024-05-16 07:20:48 +00:00
with:
2024-05-16 11:49:59 +00:00
node-version: 20
2024-05-16 08:35:44 +00:00
2024-05-16 07:20:48 +00:00
- name: Install dependencies
run: cd server && npm install
2024-05-16 08:35:44 +00:00
2024-05-16 07:20:48 +00:00
- name: Run tests and collect coverage
run: cd server && npm run test:cov
2024-05-16 08:35:44 +00:00
2024-05-16 07:20:48 +00:00
- name: Upload coverage to Codecov
2024-05-16 11:35:43 +00:00
uses: codecov/codecov-action@v4
2024-05-16 07:20:48 +00:00
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}