Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,18 @@ jobs:
dotnet build "${{ env.UI_PROJECT }}" -c ${{ env.BUILD_CONFIGURATION }} $BUILD_PROPS
dotnet build "${{ env.MACOS_PROJECT }}" -c ${{ env.BUILD_CONFIGURATION }} $BUILD_PROPS

# Runs the macOS composition root before publish. "Run Tests" at the end of this job
# already covered this project, but it sits after Publish and Smoke Test App Launch —
# so an unresolvable service killed the job at the smoke test, as a status-134 crash
# after packaging, and the assertion that names the service never executed. Running it
# here fails in seconds with the service name. A missing platform registration is
# invisible to per-branch CI, appearing only once both halves are merged, so this is
# the earliest point it can surface.
- name: Run macOS Tests
run: |
dotnet test GenHub/GenHub.Tests/GenHub.Tests.MacOS/GenHub.Tests.MacOS.csproj \
-c ${{ env.BUILD_CONFIGURATION }} --verbosity normal
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Publish macOS App
run: |
BUILD_PROPS="-p:Version=${{ steps.buildinfo.outputs.VERSION }} -p:GitShortHash=${{ steps.buildinfo.outputs.SHORT_HASH }} -p:PullRequestNumber=${{ steps.buildinfo.outputs.PR_NUMBER }} -p:BuildChannel=${{ steps.buildinfo.outputs.CHANNEL }}"
Expand Down Expand Up @@ -484,7 +496,9 @@ jobs:
shell: bash
run: |
while IFS= read -r test_project; do
[[ "$test_project" == *Windows* || "$test_project" == *Linux* ]] && continue
# MacOS is covered by "Run macOS Tests" before publish, so it is skipped
# here rather than run a second time.
[[ "$test_project" == *Windows* || "$test_project" == *Linux* || "$test_project" == *MacOS* ]] && continue
echo "Testing $test_project"
dotnet test "$test_project" -c ${{ env.BUILD_CONFIGURATION }} --verbosity normal
done < <(find GenHub/GenHub.Tests -type f -name '*.csproj' | sort)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using System.Runtime.Versioning;
using GenHub.Core.Interfaces.GameInstallations;
using GenHub.Core.Interfaces.GameSettings;
using GenHub.Core.Interfaces.Shortcuts;
using GenHub.Core.Interfaces.Storage;
using GenHub.Core.Interfaces.Workspace;
using GenHub.Features.AppUpdate.Interfaces;
using GenHub.Features.AppUpdate.Services;
using GenHub.Features.GameSettings;
using GenHub.Features.Workspace;
using GenHub.MacOS.Features.Shortcuts;
using GenHub.MacOS.GameInstallations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.Runtime.Versioning;

namespace GenHub.MacOS.Infrastructure.DependencyInjection;

Expand All @@ -23,8 +29,21 @@ public static class MacOSServicesModule
public static IServiceCollection AddMacOSServices(this IServiceCollection services)
{
services.AddSingleton<IGameInstallationDetector, MacOSInstallationDetector>();
services.AddSingleton<IGamePathProvider, MacOSGamePathProvider>();
services.AddSingleton<ISymlinkCapabilityProvider, UnixSymlinkCapabilityProvider>();
services.AddSingleton<IShortcutService, MacOSShortcutService>();

// Real hard links via link(2). Without this the base implementation throws, which
// is deliberate: silently copying made a missing registration invisible while
// every workspace consumed a full copy of the game.
services.AddScoped<IFileOperationsService>(serviceProvider =>
{
var baseService = serviceProvider.GetRequiredService<FileOperationsService>();
var casService = serviceProvider.GetRequiredService<ICasService>();
var logger = serviceProvider.GetRequiredService<ILogger<UnixFileOperationsService>>();
return new UnixFileOperationsService(baseService, casService, logger);
});

// Disables self-update on macOS, which publishes no update artifacts.
// AppServices.ConfigureApplicationServices invokes the platform module after
// AddAppUpdateModule, so this registration supersedes VelopackUpdateManager.
Expand Down
3 changes: 3 additions & 0 deletions GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using GenHub.Common.ViewModels;
using GenHub.Core.Interfaces.Common;
using GenHub.Core.Interfaces.GameInstallations;
using GenHub.Core.Interfaces.GameSettings;
using GenHub.Core.Interfaces.Shortcuts;
using GenHub.Core.Interfaces.Workspace;
using GenHub.Features.AppUpdate.Interfaces;
Expand Down Expand Up @@ -43,7 +44,9 @@ public static class CompositionRootAssertions
[
typeof(IConfigurationProviderService),
typeof(IFileOperationsService),
typeof(IGamePathProvider),
typeof(IShortcutService),
typeof(ISymlinkCapabilityProvider),
typeof(IVelopackUpdateManager),
];

Expand Down
Loading