-
-
Notifications
You must be signed in to change notification settings - Fork 94
69 lines (59 loc) · 1.75 KB
/
ci-code.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
name: CI - Code
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/ci-code.yml
- src/**
env:
dotnetVersion: '7.0.x'
jobs:
verify_codebase:
name: Verify Codebase
runs-on: ubuntu-latest
# Assign permissions for unit tests to be reported.
# See https://github.com/dorny/test-reporter/issues/168
permissions:
statuses: write
checks: write
contents: write
pull-requests: write
steps:
# Checkout code
- name: Checkout Code
uses: actions/checkout@v4
# Install .NET
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnetVersion }}
# Build Solution
- name: Build Solution
run: dotnet build src/Promitor.sln --configuration release
# Run Automated Tests
- name: Run Unit Tests
run: dotnet test src/Promitor.Tests.Unit/Promitor.Tests.Unit.csproj --logger "trx;LogFileName=test-results.trx"
# Publish Unit Test Results
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
path: src/**/test-results.trx
code_quality:
runs-on: ubuntu-latest # or macos-latest, windows-latest
name: Code Quality (R#)
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnetVersion }}
- name: Restore NuGet Packages
run: dotnet restore src/Promitor.sln
- name: R# Code Quality
uses: muno92/[email protected]
with:
solutionPath: src/Promitor.sln
minimumSeverity: warning