Files
hiha-arvio/.github/workflows/test.yml
Ismo Vuorinen 5e0fb1d033 fix: conditionally include iOS/macOS targets only on macOS
- Add MSBuild condition to only include net8.0-ios and net8.0-maccatalyst on macOS
- On Linux/Windows, only net8.0 is included as a target framework
- Fixes GitHub dependency submission failing on Ubuntu runners
- Remove wasm-tools installation from test workflow (no longer needed)

This fixes the root cause of NETSDK1147 errors on non-macOS platforms.
2025-11-19 00:37:27 +02:00

52 lines
1.5 KiB
YAML

name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
actions: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj /p:TargetFrameworks=net8.0
- name: Build test project
run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore /p:TargetFrameworks=net8.0
- name: Run tests
run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal /p:TargetFrameworks=net8.0 --logger "trx;LogFileName=test-results.trx"
- name: Publish test results
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
if: always()
with:
name: Test Results
path: '**/test-results.trx'
reporter: dotnet-trx
fail-on-error: true
- name: Upload test results
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: always()
with:
name: test-results
path: '**/test-results.trx'
retention-days: 30