|
25 | 25 | - name: Build |
26 | 26 | run: dotnet build -c Release --no-restore |
27 | 27 | - name: Test |
28 | | - run: dotnet test -c Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover |
| 28 | + run: dotnet test -c Release --framework net8.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover |
29 | 29 | - name: Upload coverage reports to Codecov |
30 | 30 | uses: codecov/codecov-action@v7 |
31 | 31 | env: |
@@ -54,11 +54,55 @@ jobs: |
54 | 54 | name: HarpoS7.PoC_Windows_x64_SelfContained |
55 | 55 | path: ./windows/* |
56 | 56 |
|
| 57 | + net48-compatibility: |
| 58 | + runs-on: windows-latest |
| 59 | + needs: [build] |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v7 |
| 62 | + - name: Setup .NET |
| 63 | + uses: actions/setup-dotnet@v5 |
| 64 | + with: |
| 65 | + dotnet-version: 8.0.x |
| 66 | + - name: Run library tests on .NET Framework 4.8 |
| 67 | + shell: pwsh |
| 68 | + run: | |
| 69 | + $testProjects = @( |
| 70 | + 'HarpoS7.Tests/HarpoS7.Tests.csproj', |
| 71 | + 'HarpoS7.Family0.Tests/HarpoS7.Family0.Tests.csproj', |
| 72 | + 'HarpoS7.Utilities.Tests/HarpoS7.Utilities.Tests.csproj', |
| 73 | + 'HarpoS7.PublicKeys.Tests/HarpoS7.PublicKeys.Tests.csproj' |
| 74 | + ) |
| 75 | +
|
| 76 | + $resultsDirectory = Join-Path $env:RUNNER_TEMP 'harpos7-net48-results' |
| 77 | + foreach ($testProject in $testProjects) { |
| 78 | + $testName = [IO.Path]::GetFileNameWithoutExtension($testProject) |
| 79 | + $resultFile = "$testName.trx" |
| 80 | + dotnet test $testProject -c Release --framework net48 ` |
| 81 | + --logger "trx;LogFileName=$resultFile" ` |
| 82 | + --results-directory $resultsDirectory |
| 83 | + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
| 84 | +
|
| 85 | + [xml]$testResult = Get-Content (Join-Path $resultsDirectory $resultFile) |
| 86 | + if ([int]$testResult.TestRun.ResultSummary.Counters.total -eq 0) { |
| 87 | + throw "No .NET Framework 4.8 tests were discovered for $testProject" |
| 88 | + } |
| 89 | + } |
| 90 | + - uses: actions/download-artifact@v7 |
| 91 | + with: |
| 92 | + name: HarpoS7-NuGet-Packages |
| 93 | + path: ./artifacts |
| 94 | + - name: Validate .NET Framework 4.8 NuGet packages |
| 95 | + shell: pwsh |
| 96 | + run: | |
| 97 | + $packageSource = (Resolve-Path ./artifacts).Path |
| 98 | + dotnet restore HarpoS7.NetFramework48.SmokeTest/HarpoS7.NetFramework48.SmokeTest.csproj -p:RestoreAdditionalProjectSources="$packageSource" |
| 99 | + dotnet run --project HarpoS7.NetFramework48.SmokeTest/HarpoS7.NetFramework48.SmokeTest.csproj -c Release --no-restore |
| 100 | +
|
57 | 101 | publish-nuget: |
58 | 102 | runs-on: ubuntu-latest |
59 | 103 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
60 | 104 | environment: nuget-release |
61 | | - needs: [build] |
| 105 | + needs: [build, net48-compatibility] |
62 | 106 | permissions: |
63 | 107 | id-token: write # enable GitHub OIDC token issuance for this job |
64 | 108 | steps: |
|
0 commit comments