From b903941a4ccddbdb04ab237043f0a97543b3432a Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 18 Nov 2025 14:08:13 +0200 Subject: [PATCH] fix: Force net8.0 target framework in test workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add -p:TargetFramework=net8.0 to all dotnet commands in test workflow to prevent transitive restoration of iOS/macOS target frameworks. **Problem**: - Test project references main HihaArvio project - Main project has multi-target frameworks (net8.0, net8.0-ios, net8.0-maccatalyst) - Restoring test project transitively restores all target frameworks - iOS/macOS frameworks require macOS-specific workloads - These workloads don't exist on Ubuntu runners **Solution**: Add `-p:TargetFramework=net8.0` to: - dotnet restore (only restore for net8.0) - dotnet build (only build for net8.0) - dotnet test (only test for net8.0) **Verification**: Tested locally - all 189 tests pass with this approach. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ab9967..e393328 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,13 +21,13 @@ jobs: dotnet-version: '8.0.x' - name: Restore dependencies - run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj + run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj -p:TargetFramework=net8.0 - name: Build test project - run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore + run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore -p:TargetFramework=net8.0 - name: Run tests - run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" + run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal -p:TargetFramework=net8.0 --logger "trx;LogFileName=test-results.trx" - name: Publish test results uses: dorny/test-reporter@v1