-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support .NET 9.0 (net9.0) * Add net9.0 support to workflows * Add net9.0 support to code coverage workflow * Fix creation of tool package, update README.md
- Loading branch information
Showing
13 changed files
with
229 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
docker run --rm --name LockCheck.Tests -v ${PSScriptRoot}/..:/mnt/lc -w /mnt/lc mcr.microsoft.com/dotnet/sdk:8.0 bash /mnt/lc/test/test-linux.sh | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$SourcesRootDir=((Get-Item $PSScriptRoot).Parent.FullName) | ||
$ContainerWorkDir="/mnt/lc" | ||
$ImageName="$env:USERNAME-lockcheck-tests" | ||
$ContainerName="LockCheck.Tests" | ||
$ContextDir="$SourcesRootDir\artifacts\TestContainer" | ||
$DockerFileContent=@' | ||
FROM mcr.microsoft.com/dotnet/sdk:9.0 as build | ||
# Copy .NET 8.0 runtime files | ||
COPY --from=mcr.microsoft.com/dotnet/sdk:8.0 /usr/share/dotnet/shared /usr/share/dotnet/shared | ||
'@ | ||
|
||
# Create a docker image that combines multiple dotnet versions | ||
mkdir -Force $ContextDir | Out-Null | ||
echo $DockerFileContent > "$ContextDir\Dockerfile" | ||
docker build -q -t $ImageName $ContextDir | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "Failed to create container" | ||
exit 1 | ||
} | ||
|
||
# Run tests | ||
docker run --rm --name $ContainerName -v ${SourcesRootDir}:$ContainerWorkDir -w $ContainerWorkDir $ImageName bash $ContainerWorkDir/test/test-linux.sh | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "Failed to run tests" | ||
exit 1 | ||
} | ||
|
||
# Don't rely on "prune" to be run eventually. | ||
# If tests were successfull we don't need it anymore. | ||
docker image rm $ImageName | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "Failed to remove image $ImageName" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
#!/bin/bash | ||
# | ||
# Run test cycle on linux. This script can be run directly from within Linux (e.g. WSL), | ||
# and also serves as the driver to be run inside a docker container (see test-docker-linux.ps1). | ||
# | ||
|
||
frameworks=('net8.0') | ||
frameworks=('net8.0' 'net9.0') | ||
configurations=('Release' 'Debug') | ||
platforms=('x64') | ||
project="$(dirname $0)/LockCheck.Tests/LockCheck.Tests.csproj" | ||
resultsDir="$(dirname $0)/../artifacts/TestResults" | ||
|
||
export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
|
||
# TODO: This issue https://github.com/dotnet/sdk/issues/29742 prevents us from running | ||
# the build separately, like on Windows, and thus less often then with every test | ||
# combination. | ||
for framework in "${frameworks[@]}"; do | ||
for configuration in "${configurations[@]}"; do | ||
for platform in "${platforms[@]}"; do | ||
echo -e "\n\033[34m[$framework - $configuration - $platform]\033[0m" | ||
/usr/share/dotnet/dotnet test --logger console -c $configuration -f $framework -a $platform $project || exit 1 | ||
runPivot=$(echo "${configuration}_${framework}_linux-${platform}" | tr '[:upper:]' '[:lower:]') | ||
/usr/share/dotnet/dotnet test --logger console --results-directory "$resultsDir/$runPivot" -c $configuration -f $framework -a $platform $project || exit 1 | ||
done | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.