-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.41 KB
/
codecov_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Codecov Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
Frontend-Codecov-Publishing:
runs-on: ubuntu-latest
steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@v2
# Setup .NET environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
# Restore dependencies
- name: Install dependencies
run: npm install
working-directory: ./frontend
# Build the project
- name: Build
run: npm run build
working-directory: ./frontend
# Step 5: Run tests and collect code coverage
- name: Test and calculate coverage
run: npm run test:coverage
working-directory: ./frontend
# Step 6: Upload the code coverage report to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # Add the Codecov token in the GitHub secrets
files: ./frontend/coverage/lcov.info # Ensure the correct path for the coverage file
flags: vite-tests
fail_ci_if_error: true
# # Setup .NET environment
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# context: ./backend
# dotnet-version: 6.0.x # Use the version your project requires
# # Restore dependencies
# - name: Restore dependencies
# run: dotnet restore ./backend
# # Build the project
# - name: Build
# run: dotnet build ./backend --no-restore
# # Step 5: Run tests and collect code coverage
# - name: Test and calculate coverage
# run: |
# dotnet test ./backend --no-build --verbosity normal --logger "console;verbosity=detailed" \
# /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
# /p:CoverletOutput=./TestResults/coverage.cobertura.xml
# # Step 6: Upload the code coverage report to Codecov
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# context: ./backend
# token: ${{ secrets.CODECOV_TOKEN }} # Add the Codecov token in the GitHub secrets
# files: ./TestResults/coverage.opencover.xml # Ensure the correct path for the coverage file
# flags: unittests
# fail_ci_if_error: true