game_version_update_patch #897
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Fully | |
on: | |
repository_dispatch: | |
types: [game_version_update, game_version_update_patch] | |
push: | |
branches: | |
- dev | |
paths: | |
- '.github/workflows/test-full.yml' | |
# - 'src/**' | |
# - 'tests/**' | |
# - 'build/**' | |
pull_request: | |
branches: | |
- master | |
# will be triggered when undrafting or requesting review | |
types: [review_requested, ready_for_review] | |
paths: | |
- '.github/workflows/test-full.yml' | |
- 'src/**' | |
- 'tests/**' | |
- 'build/**' | |
env: | |
# Disable the .NET logo in the console output. | |
DOTNET_NOLOGO: true | |
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build. | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
# Disable sending .NET CLI telemetry to Microsoft. | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
TEST_FILTERS: "+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]* -[*]System.Diagnostics.CodeAnalysis* -[*]BUTR.DependencyInjection* -[*]Bannerlord.BUTR.Shared* -[*]HarmonyLib.BUTR*" | |
jobs: | |
test: | |
name: Test Fully | |
runs-on: windows-latest | |
steps: | |
- name: Tests Setup | |
uses: butr/actions-tests-setup@v1 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
- name: Test | |
run: | | |
$testproj = "$PWD/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj"; | |
$testprojimpl = "$PWD/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj"; | |
[string[]]$gameversions = Get-Content -Path supported-game-versions.txt; | |
For ($i = 0; $i -le $gameversions.Length - 1; $i++) | |
{ | |
$gameversion = $gameversions[$i]; | |
$gamefolder = "$PWD/bannerlord-$gameversion"; | |
New-Item -ItemType directory -Force -Path "$gamefolder"; | |
dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 261552 -beta $gameversion -filelist "$PWD/.github/resources/FileFilters.regexp" -username "${{secrets.STEAM_LOGIN}}" -password "${{secrets.STEAM_PASSWORD}}" -dir "$gamefolder"; | |
} | |
opencover/OpenCover.Console.exe -returntargetcode -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Debug -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -output:"coverage_butterlib_$($gameversions[-1])_debug.xml" -mergebyhash; | |
opencover/OpenCover.Console.exe -returntargetcode -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Release -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -output:"coverage_butterlib_$($gameversions[-1])_release.xml" -mergebyhash; | |
For ($i = 0; $i -le $gameversions.Length - 1; $i++) | |
{ | |
$gameversion = $gameversions[$i]; | |
$gamefolder = "$PWD/bannerlord-$gameversion"; | |
opencover/OpenCover.Console.exe -returntargetcode -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Debug -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -output:"coverage_butterlib_impl_$($gameversion)_debug.xml" -mergebyhash; | |
opencover/OpenCover.Console.exe -returntargetcode -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -output:"coverage_butterlib_impl_$($gameversion)_release.xml" -mergebyhash; | |
} | |
shell: pwsh | |
- name: ReportGenerator | |
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 | |
with: | |
reports: '*.xml' | |
targetdir: 'coveragereport' | |
reporttypes: 'HtmlInline;Cobertura' | |
sourcedirs: './' | |
tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version. | |
- name: Upload ReportGenerator to GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coveragereport | |
- name: Upload ReportGenerator to CodeCov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: coveragereport/Cobertura.xml | |
fail_ci_if_error: true |