Skip to content

Commit

Permalink
Merge pull request #69 from BUTR/dev
Browse files Browse the repository at this point in the history
1.0.28
  • Loading branch information
artifixer authored Aug 21, 2021
2 parents c063799 + 110f551 commit dc56aa2
Show file tree
Hide file tree
Showing 29 changed files with 150 additions and 264 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "Newtonsoft.Json"
- dependency-name: "Bannerlord.ReferenceAssemblies.*"
- dependency-name: "Lib.Harmony"
- dependency-name: "Microsoft.Extensions.*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
35 changes: 3 additions & 32 deletions .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,10 @@ jobs:
name: DocFX documentation
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: DocFX Setup
uses: butr/actions-docfx-setup@v1.1
with:
submodules: recursive
fetch-depth: 0

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.x
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 5.0.x
- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: 'latest'

- name: Generating Newtonsoft.Json xref maps
run: >-
dotnet run -p build/SandcastleXrefGenerator -- `
Newtonsoft.Json 11.0.2 netstandard2.0 `
https://www.newtonsoft.com/json/help/html/ `
$PWD/docs/xrefs/Newtonsoft.Json-xrefmap.yml
shell: pwsh
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Build Bannerlord.ButterLib and DocFx.Plugin.LastModified
run: >-
Expand Down
69 changes: 12 additions & 57 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,10 @@ jobs:
name: Build for NexusMods (Stable)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
- name: Setup
uses: butr/actions-common-setup@v1.2
with:
dotnet-version: 5.0.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Build Bannerlord.ButterLib Module
run: |
Expand Down Expand Up @@ -88,20 +78,10 @@ jobs:
runs-on: ubuntu-latest
if: ${{false}}
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
- name: Setup
uses: butr/actions-common-setup@v1.2
with:
dotnet-version: 3.1.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Download stable bannerlord folder
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -162,25 +142,10 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
- name: Setup
uses: butr/actions-common-setup@v1.2
with:
dotnet-version: 5.0.x

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Pack Bannerlord.ButterLib (Release)
run: dotnet pack src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj --configuration Release -o "./packages"
Expand Down Expand Up @@ -222,20 +187,10 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
- name: Setup
uses: butr/actions-common-setup@v1.2
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Download stable bannerlord folder
uses: actions/download-artifact@v2
Expand Down
69 changes: 15 additions & 54 deletions .github/workflows/test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
# If a new version of the game is released, test the repo against it.
# This way we will always know if the repo is broken on a new update.
- game_version_update
# push:
# branches:
# - dev
# paths:
# - '.github/workflows/test-full.yml'
push:
branches:
- dev
paths:
- '.github/workflows/test-full.yml'
# - 'src/**'
# - 'tests/**'
# - 'build/**'
Expand All @@ -32,62 +32,23 @@ env:
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: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 5.0.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Download DepotDownloader_2.3.6
uses: i3h/download-release-asset@v1
- name: Tests Setup
uses: butr/actions-tests-setup@v1.5
with:
owner: SteamRE
repo: DepotDownloader
tag: DepotDownloader_2.3.6
file: depotdownloader-2.3.6.zip

- name: Extract DepotDownloader_2.3.6
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: depotdownloader-2.3.6.zip
pathTarget: depotdownloader

- name: Download opencover.4.7.922
uses: i3h/download-release-asset@v1
with:
owner: OpenCover
repo: opencover
tag: 4.7.922
file: opencover.4.7.922.zip

- name: Extract opencover.4.7.922
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: opencover.4.7.922.zip
pathTarget: opencover
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";
$filter = "+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*";
$gameversions = Get-Content -Path supported-game-versions.txt;
For ($i = 0; $i -le $gameversions.Length - 1; $i++)
Expand All @@ -100,20 +61,20 @@ jobs:
dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta $gameversion -filelist "$PWD/.github/resources/FileFilters.regexp" -username "${{secrets.STEAM_LOGIN}}" -password "${{secrets.STEAM_PASSWORD}}" -dir "$gamefolder";
}
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Debug -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"$filter" -output:"coverage_butterlib_$($gameversions[-1])_debug.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Release -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"$filter" -output:"coverage_butterlib_$($gameversions[-1])_release.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Debug -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_$($gameversions[-1])_debug.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Release -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -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 -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Debug -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"$filter" -output:"coverage_butterlib_impl_$($gameversion)_debug.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"$filter" -output:"coverage_butterlib_impl_$($gameversion)_release.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Debug -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_impl_$($gameversion)_debug.xml" -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_impl_$($gameversion)_release.xml" -mergebyhash;
}
shell: pwsh

- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@4.6.1
uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12
with:
reports: '*.xml'
targetdir: 'coveragereport'
Expand All @@ -128,7 +89,7 @@ jobs:
path: coveragereport

- name: Upload ReportGenerator to CodeCov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coveragereport/Cobertura.xml
Expand Down
78 changes: 18 additions & 60 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,65 +32,23 @@ env:
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
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 5.0.x

- name: Setup BUTR GPR
uses: actions/setup-dotnet@master
with:
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Download DepotDownloader_2.3.6
uses: i3h/download-release-asset@v1
with:
owner: SteamRE
repo: DepotDownloader
tag: DepotDownloader_2.3.6
file: depotdownloader-2.3.6.zip

- name: Extract DepotDownloader_2.3.6
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: depotdownloader-2.3.6.zip
pathTarget: depotdownloader

- name: Download Bannerlord binaries (Stable)
run: >-
dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta ${{secrets.SYNCED_GAME_STABLE_VERSION}} -username ${{secrets.STEAM_LOGIN}}
-password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord-stable
shell: pwsh
- name: Download Bannerlord binaries (Beta)
run: >-
dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta ${{secrets.SYNCED_GAME_BETA_VERSION}} -username ${{secrets.STEAM_LOGIN}}
-password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord-beta
shell: pwsh

- name: Download opencover.4.7.922
uses: i3h/download-release-asset@v1
with:
owner: OpenCover
repo: opencover
tag: 4.7.922
file: opencover.4.7.922.zip

- name: Extract opencover.4.7.922
uses: DuckSoft/extract-7z-action@v1.0
- name: Tests Setup
uses: butr/actions-tests-setup@v1.4
with:
pathSource: opencover.4.7.922.zip
pathTarget: opencover
github-token: ${{secrets.GITHUB_TOKEN}}
steam-login: ${{secrets.STEAM_LOGIN}}
steam-password: ${{secrets.STEAM_PASSWORD}}
stable-version: ${{secrets.SYNCED_GAME_STABLE_VERSION}}
beta-version: ${{secrets.SYNCED_GAME_BETA_VERSION}}
stable-directory: 'bannerlord-stable'
beta-directory: 'bannerlord-beta'

- name: Test
run: >-
Expand All @@ -111,16 +69,16 @@ jobs:

- name: Test Coverage
run: >-
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_stable_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_stable_release.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_stable_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_stable_release.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_beta_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_beta_release.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_stable_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_stable_release.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_stable_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_stable_release.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_beta_debug.xml -mergebyhash;
opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_beta_release.xml -mergebyhash;
shell: pwsh

- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@4.6.1
uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12
with:
reports: 'coverage_butterlib_stable_debug.xml;coverage_butterlib_stable_release.xml;coverage_butterlib_impl_stable_debug.xml;coverage_butterlib_impl_stable_release.xml;coverage_butterlib_impl_beta_debug.xml;coverage_butterlib_impl_beta_release.xml;'
targetdir: 'coveragereport'
Expand All @@ -135,7 +93,7 @@ jobs:
path: coveragereport

- name: Upload ReportGenerator to CodeCov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coveragereport/Cobertura.xml
Expand Down
Loading

0 comments on commit dc56aa2

Please sign in to comment.