From db28c1eaa07afabbcdfd57a9b2a06c33170d02fb Mon Sep 17 00:00:00 2001 From: David Vreony Date: Wed, 11 Mar 2026 22:32:55 +0000 Subject: [PATCH 1/5] Refactor CI workflow for .NET Core Updated CI workflow for .NET, streamlined permissions and job structure. --- .github/workflows/dotnet-core.yml | 184 ++++-------------------------- 1 file changed, 21 insertions(+), 163 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 8e995b2..3224e86 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -1,172 +1,30 @@ -name: .NET Core +name: CI .NET on: push: branches: [ main ] pull_request: - types: [opened, synchronize, reopened, closed] + types: [opened, synchronize, reopened] branches: [ main ] +permissions: + contents: read + jobs: build: - runs-on: windows-latest - outputs: - nbgv: ${{ steps.nbgv.outputs.SemVer2 }} - env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_NOLOGO: true - DOTNET_GENERATE_ASPNET_CERTIFICATE: false - solutionpath: src\NetTestRegimentation.sln - unittestprojectpath: src\NetTestRegimentation.UnitTests\NetTestRegimentation.UnitTests.csproj - steps: - - name: Checkout code - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Setup .NET 5 - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 5.0.x - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 6.0.x - - - name: NBGV - id: nbgv - uses: dotnet/nbgv@master - with: - setAllVars: true - - - name: Install dotnet tools - run: | - dotnet tool install --global dotMorten.OmdGenerator - dotnet tool install --global ConfigValidate - dotnet tool install --global dotnet-outdated-tool - dotnet tool install --global snitch - dotnet tool install --global dotnet-sonarscanner - dotnet tool install --global JetBrains.ReSharper.GlobalTools - - - name: Prepare Artifact Directory - run: | - mkdir artifacts - mkdir artifacts\nupkg - mkdir artifacts\outdated - mkdir artifacts\snitch - mkdir artifacts\omd - mkdir artifacts\docfx - - - name: Restore Packages - run: | - dotnet restore ${{ env.solutionpath }} /bl:artifacts\\binlog\\restore.binlog - - - name: Run Build - run: | - dotnet build ${{ env.solutionpath }} --configuration Release --no-restore /bl:artifacts\\binlog\\build.binlog /p:ContinuousIntegrationBuild=true - - - name: Run Unit Tests - run: | - dotnet test ${{ env.unittestprojectpath }} --configuration Release --no-build /bl:artifacts\\binlog\\unittest.binlog --nologo --blame-hang-timeout 60000 --results-directory artifacts\opencover --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - - - name: Upload Code Coverage - shell: bash - run: | - echo $PWD - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -t ${{ env.CODECOV_TOKEN }} -s '$PWD/artifacts/opencover' -f '*.xml' - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - - name: Produce Nuget Packages - run: | - dotnet pack ${{ env.solutionpath }} --configuration Release --no-build /bl:artifacts\\binlog\\pack.binlog --nologo /p:PackageOutputPath=..\..\artifacts\nuget /p:ContinuousIntegrationBuild=true - - - name: List outdated packages - run: | - dotnet outdated -o artifacts\outdated\outdated.json src - -# only store binlog on failure - - name: store binlogs - if: ${{ failure() }} - uses: actions/upload-artifact@v6 - with: - name: binlogs - path: artifacts/binlog - - - name: store docfx - uses: actions/upload-artifact@v6 - with: - name: docfx - path: artifacts/docfx - - - name: store nuget packages - uses: actions/upload-artifact@v6 - with: - name: nuget - path: artifacts/nuget - - - name: store omd - uses: actions/upload-artifact@v6 - with: - name: omd - path: artifacts/omd - - - name: store outdated - uses: actions/upload-artifact@v6 - with: - name: outdated - path: artifacts/outdated - - - name: store snitch - uses: actions/upload-artifact@v6 - with: - name: snitch - path: artifacts/snitch - - - name: store resharper dupfinder - uses: actions/upload-artifact@v6 - with: - name: dupfinder - path: artifacts/dupfinder - release: - runs-on: ubuntu-latest - needs: build - if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true - env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_NOLOGO: true - DOTNET_GENERATE_ASPNET_CERTIFICATE: false - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Download NuGet Packages - uses: actions/download-artifact@v7.0.0 - with: - name: nuget - - - name: Changelog - uses: glennawatson/ChangeLog@v1 - id: changelog - - - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ needs.build.outputs.nbgv }} - release_name: ${{ needs.build.outputs.nbgv }} - body: | - ${{ steps.changelog.outputs.commitLog }} - - - name: NuGet Push - env: - NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} - SOURCE_URL: https://api.nuget.org/v3/index.json - run: | - dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg + permissions: + actions: write + contents: write + deployments: read + pages: write + id-token: write + pull-requests: write + packages: read + security-events: write + uses: dpvreony/github-action-workflows/.github/workflows/dotnet-ci.yml@1.8.1 + with: + solutionName: "NetTestRegimentation" + apiDocumentation: "None" + secrets: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 71f4b4d48d50c1d12fc51483e67931729d5318c5 Mon Sep 17 00:00:00 2001 From: David Vreony Date: Wed, 11 Mar 2026 22:37:48 +0000 Subject: [PATCH 2/5] Add global.json to configure SDK and test runner --- global.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 0000000..fd06fb7 --- /dev/null +++ b/global.json @@ -0,0 +1,10 @@ +{ + "sdk": { + "version": "10.0.200", + "rollForward": "disable", + "allowPrerelease": false + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } +} From 4a940e9db53c00f299c6bfc59bb649b0bd398712 Mon Sep 17 00:00:00 2001 From: David Vreony Date: Wed, 11 Mar 2026 22:43:17 +0000 Subject: [PATCH 3/5] rename dir.build files --- src/{Directory.build.props => Directory.Build.props} | 0 src/{Directory.build.targets => Directory.Build.targets} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{Directory.build.props => Directory.Build.props} (100%) rename src/{Directory.build.targets => Directory.Build.targets} (100%) diff --git a/src/Directory.build.props b/src/Directory.Build.props similarity index 100% rename from src/Directory.build.props rename to src/Directory.Build.props diff --git a/src/Directory.build.targets b/src/Directory.Build.targets similarity index 100% rename from src/Directory.build.targets rename to src/Directory.Build.targets From a2913cbed227ae4628705a8ca16429ae33c69881 Mon Sep 17 00:00:00 2001 From: David Vreony Date: Wed, 11 Mar 2026 22:47:21 +0000 Subject: [PATCH 4/5] Update target framework to net10.0 Changed target framework from multiple versions to net10.0. --- .../NetTestRegimentation.UnitTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetTestRegimentation.UnitTests/NetTestRegimentation.UnitTests.csproj b/src/NetTestRegimentation.UnitTests/NetTestRegimentation.UnitTests.csproj index 5d3bc15..0b05e43 100644 --- a/src/NetTestRegimentation.UnitTests/NetTestRegimentation.UnitTests.csproj +++ b/src/NetTestRegimentation.UnitTests/NetTestRegimentation.UnitTests.csproj @@ -1,7 +1,7 @@  - net48;net8.0 + net10.0 exe From 3cb18840a9540e5658490b41e00e4fe99fc1a369 Mon Sep 17 00:00:00 2001 From: David Vreony Date: Wed, 11 Mar 2026 22:49:28 +0000 Subject: [PATCH 5/5] Update renovate.json to extend local configuration --- renovate.json | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/renovate.json b/renovate.json index b8a8694..e3d009d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,48 +1,3 @@ { - "extends": [ - "config:base" - ], - "assigneesFromCodeOwners": true, - "packageRules": [{ - "matchPackagePatterns": ["Audit.*"], - "groupName": "all audit.net dependencies", - "groupSlug": "all-audit-net", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["Exceptionless.*"], - "groupName": "all exceptionless dependencies", - "groupSlug": "all-exceptionless", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["Foundatio.*"], - "groupName": "all foundatio dependencies", - "groupSlug": "all-foundatio", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["Microsoft.*", "System.*"], - "groupName": "all microsoft dependencies", - "groupSlug": "all-microsoft", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["ReactiveUI.*"], - "groupName": "all reactiveui dependencies", - "groupSlug": "all-reactiveui", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["Xamarin.*"], - "groupName": "all xamarin dependencies", - "groupSlug": "all-xamarin", - "labels": ["dependencies"] - }, - { - "matchPackagePatterns": ["Xunit.*"], - "groupName": "all xunit dependencies", - "groupSlug": "all-xunit", - "labels": ["dependencies"] - }] + "extends": ["local>dpvreony/.github:renovate"] }