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

34 lines
680 B
YAML
Raw Normal View History

2024-05-16 08:35:44 +00:00
# Unit Test Coverage Report
name: Test Coverage
on:
pull_request:
branches:
- feature/workflow
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 07:20:48 +00:00
uses: actions/setup-node@v3
with:
2024-05-16 08:35:44 +00:00
node-version: 18
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
uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}