-
Notifications
You must be signed in to change notification settings - Fork 52
55 lines (41 loc) · 1.72 KB
/
pr-build.yml
File metadata and controls
55 lines (41 loc) · 1.72 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
name: PR Build
on:
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore .NET tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore RestClient.sln
- name: Check code formatting with CSharpier
run: dotnet csharpier --check .
- name: Build solution
run: dotnet build RestClient.sln --configuration Release --no-restore /warnaserror
- name: Run code analysis
run: dotnet build RestClient.sln --configuration Release --no-restore /p:RunAnalyzers=true /p:TreatWarningsAsErrors=true
- name: Run Stryker Mutation Testing
working-directory: RestClient.Net.CsTest
run: dotnet stryker --break-at 100
- name: Verify Docker is available
run: |
docker --version
docker compose version
- name: Run all tests with code coverage
run: dotnet test RestClient.sln --configuration Release --no-build --verbosity normal --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Threshold=100 DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdType=line,branch,method DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdStat=total
- name: Cleanup Docker containers
if: always()
run: |
cd Samples/NucliaDbClient
docker compose down -v --remove-orphans || true