-
Notifications
You must be signed in to change notification settings - Fork 0
Test new folder structure with workflows #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
75d8c09
54e6daf
066c8ff
3b89e02
b0a2f21
84c2fd1
aa60094
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: Code Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '8.x' # Adjust to your .NET version | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore | ||
|
|
||
| - name: Build | ||
| run: dotnet build --no-restore --configuration Release | ||
|
|
||
| - name: Run TUNIT tests with coverage | ||
| run: | | ||
| dotnet test ./tests --no-build --configuration Release \ | ||
| --collect:"XPlat Code Coverage" \ | ||
| --results-directory ./test-results \ | ||
| --logger "trx;LogFileName=TestResults.trx" \ | ||
| --logger "console;verbosity=detailed" | ||
|
|
||
| - name: Install ReportGenerator | ||
| run: dotnet tool install -g dotnet-reportgenerator-globaltool | ||
|
|
||
| - name: Generate coverage report | ||
| run: | | ||
| reportgenerator \ | ||
| -reports:"./test-results/**/coverage.cobertura.xml" \ | ||
| -targetdir:"./coverage-report" \ | ||
| -reporttypes:"Html;Cobertura;MarkdownSummaryGithub" | ||
|
|
||
| - name: Upload test results | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: test-results | ||
| path: | | ||
| ./test-results/**/*.trx | ||
| ./coverage-report/**/* | ||
|
|
||
| - name: Publish test results | ||
| uses: dorny/test-reporter@v1 | ||
| if: always() | ||
| with: | ||
| name: Test Results | ||
| path: './test-results/**/*.trx' | ||
| reporter: dotnet-trx | ||
|
|
||
| - name: Code Coverage Report | ||
| uses: irongut/CodeCoverageSummary@v1.3.0 | ||
| with: | ||
| filename: ./coverage-report/Cobertura.xml | ||
| badge: true | ||
| fail_below_min: false # Set to true if you want to fail on low coverage | ||
| format: markdown | ||
| hide_branch_rate: false | ||
| hide_complexity: false | ||
| indicators: true | ||
| output: both | ||
| thresholds: '60 80' # Warning at 60%, error below 80% | ||
|
|
||
| - name: Add Coverage PR Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| if: github.event_name == 'pull_request' | ||
| with: | ||
| recreate: true | ||
| path: code-coverage-results.md | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,142 @@ | ||||||
| name: Release | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [ release, release/* ] # Trigger on release branch(es) | ||||||
| workflow_dispatch: # Allows manual trigger from any branch | ||||||
|
|
||||||
| jobs: | ||||||
| build-and-test: | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| outputs: | ||||||
| version: ${{ steps.nbgv.outputs.SemVer2 }} | ||||||
| simple-version: ${{ steps.nbgv.outputs.SimpleVersion }} | ||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| with: | ||||||
| fetch-depth: 0 # Full history needed for Nerdbank.GitVersioning | ||||||
|
|
||||||
| - name: Setup .NET | ||||||
| uses: actions/setup-dotnet@v4 | ||||||
| with: | ||||||
| dotnet-version: '8.x' # Adjust to your .NET version | ||||||
|
||||||
| dotnet-version: '8.x' # Adjust to your .NET version | |
| dotnet-version: '9.x' # Adjust to your .NET version |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .NET version should be '9.x' to match the project's target framework (net9.0).
| dotnet-version: '8.x' | |
| dotnet-version: '9.x' |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder 'YourPackageName' should be replaced with the actual package name 'TvdbClient' based on the project structure.
| echo "dotnet add package YourPackageName --version ${{ needs.build-and-test.outputs.version }}" >> release_notes.md | |
| echo "dotnet add package TvdbClient --version ${{ needs.build-and-test.outputs.version }}" >> release_notes.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <ItemGroup> | ||
| <PropertyGroup Label="Project Properties"> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <RootNamespace>Tvdb</RootNamespace> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
| <ItemGroup Label="Versioning"> | ||
| <PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <Version>3.7.115</Version> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
| <PropertyGroup Label="Variables"> | ||
| <CurrentYear>$([System.DateTime]::Now.ToString("yyyy"))</CurrentYear> | ||
| </PropertyGroup> | ||
| </Project> |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .NET version comment indicates '8.x' but the project targets net9.0. Update the dotnet-version to '9.x' to match the project's target framework.