-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (58 loc) · 1.75 KB
/
ci.yml
File metadata and controls
75 lines (58 loc) · 1.75 KB
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Check formatting
run: dotnet format --verify-no-changes --verbosity diagnostic
- name: Test with coverage
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/**/coverage.cobertura.xml
flags: backend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
build-and-test-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./DocumentGenerator.Client
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ./DocumentGenerator.Client/package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test with coverage
run: npm test -- --run --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./DocumentGenerator.Client/coverage/coverage-final.json
flags: frontend
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
run: npm run build