-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.46 KB
/
Copy pathci.yml
File metadata and controls
74 lines (63 loc) · 2.46 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
# Copyright 2026 Ari Sulistiono
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
permissions:
contents: read
jobs:
build-test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore ARIEC60870.sln
- name: Build with release warning gate
run: dotnet build ARIEC60870.sln --configuration Release --no-restore -p:TreatWarningsAsErrors=true
- name: Check code formatting
shell: pwsh
continue-on-error: true
run: |
dotnet format ARIEC60870.sln --verify-no-changes --verbosity minimal
- name: Run dependency-free protocol smoke tests
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts/test-results | Out-Null
dotnet run --project tests/ARIEC60870.Protocol.Tests/ARIEC60870.Protocol.Tests.csproj --configuration Release --no-build 2>&1 | Tee-Object -FilePath artifacts/test-results/protocol-smoke-tests.log
- name: Run xUnit regression suites with TRX and coverage
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force -Path artifacts/test-results | Out-Null
$projects = @(
'tests/ARIEC60870.Core.Tests/ARIEC60870.Core.Tests.csproj',
'tests/ARIEC60870.Master.Tests/ARIEC60870.Master.Tests.csproj',
'tests/ARIEC60870.Reporting.Tests/ARIEC60870.Reporting.Tests.csproj',
'tests/ARIEC60870.Desktop.Tests/ARIEC60870.Desktop.Tests.csproj',
'tests/ARIEC60870.Repository.Tests/ARIEC60870.Repository.Tests.csproj'
)
foreach ($project in $projects) {
$name = Split-Path (Split-Path $project -Parent) -Leaf
dotnet test $project `
--configuration Release `
--no-build `
--logger "trx;LogFileName=$name.trx" `
--results-directory artifacts/test-results `
--collect "XPlat Code Coverage"
}
- name: Upload test and coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ARIEC60870-test-results
path: artifacts/test-results
if-no-files-found: warn