-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (61 loc) · 1.73 KB
/
pr.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
name: Build and Test
on:
pull_request:
branches:
- main
jobs:
Website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
- name: Restore NuGet packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults --collect:"XPlat Code Coverage"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./TestResults
flags: Website
fail_ci_if_error: true
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: website-test-results
path: ./TestResults
if: ${{ always() }} # Always run this step even on failure
WebClient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '19.x'
- name: Install npm packages
run: npm ci
working-directory: ./WebClient
- name: Build
run: npm run build
working-directory: ./WebClient
- name: Test
run: npm run coverage
working-directory: ./WebClient
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./WebClient/logs/coverage/cobertura.xml
flags: WebClient
fail_ci_if_error: true
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: webclient-logs
path: ./WebClient/logs
if: ${{ always() }} # Always run this step even on failure