Files
hiha-arvio/.github/workflows/test.yml
Ismo Vuorinen 546b1ae25e fix: use TargetFrameworks property to prevent iOS/macOS restore on Ubuntu
- Change from TargetFramework (singular) to TargetFrameworks (plural)
- Overrides framework list for all projects in dependency graph
- Prevents transitive restore of iOS/macOS workloads on Linux runner
2025-11-19 00:21:15 +02:00

48 lines
1.4 KiB
YAML

name: Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
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