Skip to content

Commit b549e76

Browse files
authored
chore: clean up dependabot config and replace root dev scripts with a CI-shared coverage script (#336)
1 parent ed178cd commit b549e76

7 files changed

Lines changed: 31 additions & 107 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ updates:
77
interval: "daily"
88
open-pull-requests-limit: 10
99
groups:
10-
dotnet:
10+
actions:
1111
patterns:
1212
- "*" # Prefer a single PR per solution update.
13-
# Docker Images
14-
- package-ecosystem: "docker"
15-
directory: "/"
16-
schedule:
17-
interval: "daily"
1813
# Dotnet SDK
1914
- package-ecosystem: "dotnet-sdk"
2015
directory: "/"

.github/workflows/ci.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,8 @@ jobs:
3333
run: dotnet build -c Release
3434

3535
- name: Test with coverage
36-
run: >
37-
dotnet test -c Release --no-build --
38-
--coverage
39-
--coverage-output-format cobertura
40-
--coverage-output coverage.cobertura.xml
41-
42-
- name: Restore tools
43-
run: dotnet tool restore
44-
45-
- name: Generate coverage report & badges
46-
run: >
47-
dotnet reportgenerator
48-
-reports:"**/TestResults/coverage.cobertura.xml"
49-
-targetdir:"./CoverageReport"
50-
-reporttypes:"Html;Badges"
36+
shell: pwsh
37+
run: ./eng/coverage.ps1 -NoBuild
5138

5239
- name: Upload coverage report
5340
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

Vulthil.SharedKernel.slnx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
<File Path=".github/instructions/style-guidelines.instructions.md" />
1212
</Folder>
1313
<Folder Name="/.github/workflows/">
14+
<File Path=".github/workflows/backport.yml" />
1415
<File Path=".github/workflows/ci.yml" />
1516
<File Path=".github/workflows/claude-code-review.yml" />
1617
<File Path=".github/workflows/claude.yml" />
18+
<File Path=".github/workflows/codeql.yml" />
1719
<File Path=".github/workflows/dependabot-approve-and-automerge.yml" />
1820
<File Path=".github/workflows/docs.yml" />
1921
<File Path=".github/workflows/release.yml" />
@@ -22,6 +24,9 @@
2224
<Folder Name="/docs/">
2325
<File Path="docs/docfx.json" />
2426
</Folder>
27+
<Folder Name="/eng/">
28+
<File Path="eng/coverage.ps1" />
29+
</Folder>
2530
<Folder Name="/samples/">
2631
<File Path="samples/aspire.config.json" />
2732
<File Path="samples/Directory.Build.props" />
@@ -50,15 +55,8 @@
5055
<File Path="Directory.Packages.props" />
5156
<File Path="global.json" />
5257
<File Path="README.md" />
53-
<File Path="test-reports" />
5458
<File Path="version.json" />
5559
<File Path="Vulthil.SharedKernel.png" />
56-
<File Path="watch" />
57-
<File Path="watch-samples" />
58-
</Folder>
59-
<Folder Name="/Solution Items/TestReports/">
60-
<File Path="TestReports/Cobertura.xml" />
61-
<File Path="TestReports/index.html" />
6260
</Folder>
6361
<Folder Name="/src/">
6462
<File Path="src/Directory.Build.props" />

eng/coverage.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Single source of truth for the coverage commands run by ci.yml's "Test with
2+
# coverage" step -- keep this script and that step in sync; ci.yml invokes
3+
# this script directly instead of duplicating the commands below.
4+
5+
param(
6+
[switch]$NoBuild
7+
)
8+
9+
$ErrorActionPreference = 'Stop'
10+
$PSNativeCommandUseErrorActionPreference = $true
11+
12+
if (-not $NoBuild) {
13+
dotnet build -c Release
14+
}
15+
16+
dotnet test -c Release --no-build -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
17+
18+
dotnet tool restore
19+
20+
dotnet reportgenerator -reports:"**/TestResults/coverage.cobertura.xml" -targetdir:"./CoverageReport" -reporttypes:"Html;Badges"
21+
22+
$reportPath = Join-Path $PWD "CoverageReport" "index.html"
23+
Write-Host "Coverage report: $reportPath"

test-reports

Lines changed: 0 additions & 29 deletions
This file was deleted.

watch

Lines changed: 0 additions & 25 deletions
This file was deleted.

watch-samples

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)