Skip to content

Commit f278b30

Browse files
authored
Merge pull request #260 from AlamoEngine-Tools/develop
Update Dependencies and stabilize tests
2 parents f32e7b2 + 473dd4b commit f278b30

21 files changed

Lines changed: 4933 additions & 56 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010

1111
test:
1212
uses: ./.github/workflows/test.yml
13+
with:
14+
steam-live-tests: true
1315

1416
pack:
1517
name: Pack
@@ -51,10 +53,10 @@ jobs:
5153
path: packages
5254
- name: Push packages
5355
run: dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
54-
- uses: dotnet/nbgv@v0.5.1
56+
- uses: dotnet/nbgv@v0.5.2
5557
id: nbgv
5658
- name: Create GitHub release
57-
uses: softprops/action-gh-release@v2
59+
uses: softprops/action-gh-release@v3
5860
with:
5961
name: v${{ steps.nbgv.outputs.SemVer2 }}
6062
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}

.github/workflows/test.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ name: Build & Test
22

33
on:
44
workflow_call:
5+
inputs:
6+
steam-live-tests:
7+
description: 'Run live Steam-network tests (sets STEAM_LIVE_TESTS=1).'
8+
type: boolean
9+
default: false
510
workflow_dispatch:
11+
inputs:
12+
steam-live-tests:
13+
description: 'Run live Steam-network tests (sets STEAM_LIVE_TESTS=1).'
14+
type: boolean
15+
default: false
616
push:
717
branches: [ develop ]
818
pull_request:
@@ -16,18 +26,19 @@ jobs:
1626
matrix:
1727
os: [windows-latest, ubuntu-latest]
1828
runs-on: ${{ matrix.os }}
19-
29+
2030
steps:
2131
- uses: actions/checkout@v6
2232
with:
2333
fetch-depth: 0
2434
- uses: actions/setup-dotnet@v5
2535
with:
2636
dotnet-version: '10.0.x'
27-
37+
2838
- name: Build & Test in Release Mode
2939
run: dotnet test --configuration Release --report-github
30-
# Ignore exit code 8 on Linux (zero tests are now allowed)
40+
# Ignore exit code 8 on Linux (zero tests are now allowed)
3141
# TODO: Remove this when linux is supported
3242
env:
33-
TESTINGPLATFORM_EXITCODE_IGNORE: ${{ matrix.os == 'ubuntu-latest' && '8' || '' }}
43+
TESTINGPLATFORM_EXITCODE_IGNORE: ${{ matrix.os == 'ubuntu-latest' && '8' || '' }}
44+
STEAM_LIVE_TESTS: ${{ inputs.steam-live-tests && '1' || '' }}

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<Version>3.9.50</Version>
3333
</PackageReference>
3434
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2" PrivateAssets="all" />
35-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201">
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.300">
3636
<PrivateAssets>all</PrivateAssets>
3737
</PackageReference>
3838
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="" />

sampleApp/SampleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/AET.SteamAbstraction/AET.SteamAbstraction.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2222
</PropertyGroup>
2323
<ItemGroup>
24-
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.18" />
25-
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.18" />
26-
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.18" />
27-
<PackageReference Include="System.Text.Json" Version="10.0.5" />
28-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" />
29-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
24+
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.23" />
25+
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.23" />
26+
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.23" />
27+
<PackageReference Include="System.Text.Json" Version="10.0.8" />
28+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.8" />
29+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.8" />
3030
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" Condition="$(TargetFramework) == 'netstandard2.0'" />
3131
<PackageReference Include="Nullable" Version="1.3.1" Condition="$(TargetFramework) == 'netstandard2.0'">
3232
<PrivateAssets>all</PrivateAssets>

src/PG.StarWarsGame.Infrastructure/Clients/Processes/GameProcess.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace PG.StarWarsGame.Infrastructure.Clients.Processes;
99

1010
internal sealed class GameProcess : DisposableObject, IGameProcess
1111
{
12-
private volatile bool _closed;
12+
private int _closedFlag;
1313

1414
private EventHandler? _closingHandler;
1515

@@ -18,7 +18,7 @@ public event EventHandler? Closed
1818
add
1919
{
2020
// Execute event right away if the process was already closed.
21-
if (_closed)
21+
if (Volatile.Read(ref _closedFlag) != 0)
2222
value?.Invoke(this, EventArgs.Empty);
2323
else
2424
_closingHandler += value;
@@ -30,8 +30,8 @@ public event EventHandler? Closed
3030

3131
// To avoid complexity this property does not query the underlying process but just "trusts"
3232
// on the OnClosed function to set the value when the process was terminated.
33-
// This means this property has theoretically a race condition with the game's process.
34-
public GameProcessState State => _closed ? GameProcessState.Closed : GameProcessState.Running;
33+
// This means this property has theoretically a race condition with the game's process.
34+
public GameProcessState State => Volatile.Read(ref _closedFlag) != 0 ? GameProcessState.Closed : GameProcessState.Running;
3535

3636
internal Process Process { get; }
3737

@@ -51,10 +51,16 @@ public void Exit()
5151
try
5252
{
5353
Process.Kill();
54+
Process.WaitForExit();
5455
}
5556
catch (Exception e) when (e is InvalidOperationException or Win32Exception)
5657
{
5758
}
59+
60+
// Process.Exited is dispatched asynchronously on a ThreadPool work item, so
61+
// WaitForExit can return before OnClosed has been invoked. Drive it synchronously
62+
// here; OnClosed is idempotent via the Interlocked guard.
63+
OnClosed(this, EventArgs.Empty);
5864
}
5965

6066
public Task WaitForExitAsync(CancellationToken cancellationToken = default)
@@ -74,15 +80,13 @@ private void RegisterExitEvent(Process process)
7480
Process.EnableRaisingEvents = true;
7581
Process.Exited += OnClosed;
7682
if (process.HasExited)
77-
{
78-
_closed = true;
79-
Process.Exited -= OnClosed;
80-
}
83+
OnClosed(this, EventArgs.Empty);
8184
}
8285

8386
private void OnClosed(object? sender, EventArgs e)
8487
{
85-
_closed = true;
88+
if (Interlocked.Exchange(ref _closedFlag, 1) != 0)
89+
return;
8690
Process.Exited -= OnClosed;
8791
_closingHandler?.Invoke(this, EventArgs.Empty);
8892
}

src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<PackageReference Include="AlamoEngineTools.Modinfo" Version="8.0.2" />
26-
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.18" />
27-
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.18" />
28-
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.18" />
25+
<PackageReference Include="AlamoEngineTools.Modinfo" Version="8.0.6" />
26+
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.23" />
27+
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.23" />
28+
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.23" />
2929
<PackageReference Include="semver" Version="3.0.0" />
3030
<PackageReference Include="HtmlAgilityPack" Version="1.12.4" />
31-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" />
32-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
31+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.8" />
32+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.8" />
3333
<PackageReference Include="QuikGraph" Version="2.5.0" PrivateAssets="compile" />
34-
<PackageReference Include="System.Text.Json" Version="10.0.5" />
34+
<PackageReference Include="System.Text.Json" Version="10.0.8" />
3535
<PackageReference Include="IsExternalInit" Version="1.0.3">
3636
<PrivateAssets>all</PrivateAssets>
3737
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
17-
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.1" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
17+
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.4" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
1919
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
20-
<PackageReference Include="Microsoft.Testing.Platform" Version="2.1.0" />
20+
<PackageReference Include="Microsoft.Testing.Platform" Version="2.2.3" />
2121
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>
25-
<PackageReference Include="coverlet.collector" Version="8.0.1">
25+
<PackageReference Include="coverlet.collector" Version="10.0.1">
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
<PrivateAssets>all</PrivateAssets>
2828
</PackageReference>
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
33-
<PackageReference Include="Testably.Abstractions.Testing" Version="6.0.0" />
32+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
33+
<PackageReference Include="Testably.Abstractions.Testing" Version="6.4.0" />
3434
<ProjectReference Include="..\..\src\AET.SteamAbstraction\AET.SteamAbstraction.csproj" />
3535
<ProjectReference Include="..\AET.SteamAbstraction.Testing\AET.SteamAbstraction.Testing.csproj" />
3636
</ItemGroup>

test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
</PropertyGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="AnakinRaW.CommonUtilities.Testing" Version="13.0.18" />
29+
<PackageReference Include="AnakinRaW.CommonUtilities.Testing" Version="13.0.23" />
3030
<PackageReference Include="IsExternalInit" Version="1.0.3" Condition="$(TargetFramework) == 'netstandard2.0'">
3131
<PrivateAssets>all</PrivateAssets>
3232
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3333
</PackageReference>
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
38-
<PackageReference Include="Testably.Abstractions.Testing" Version="6.0.0" />
37+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
38+
<PackageReference Include="Testably.Abstractions.Testing" Version="6.4.0" />
3939
<ProjectReference Include="..\..\src\AET.SteamAbstraction\AET.SteamAbstraction.csproj" />
4040
</ItemGroup>
4141
</Project>

test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.1" />
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
18-
<PackageReference Include="Testably.Abstractions.Testing" Version="6.0.0" />
16+
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.4" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
18+
<PackageReference Include="Testably.Abstractions.Testing" Version="6.4.0" />
1919
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
20-
<PackageReference Include="Microsoft.Testing.Platform" Version="2.1.0" />
20+
<PackageReference Include="Microsoft.Testing.Platform" Version="2.2.3" />
2121
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>
25-
<PackageReference Include="coverlet.collector" Version="8.0.1">
25+
<PackageReference Include="coverlet.collector" Version="10.0.1">
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
<PrivateAssets>all</PrivateAssets>
2828
</PackageReference>

0 commit comments

Comments
 (0)