Skip to content

Commit

Permalink
(cake-contribGH-389) Multi-Target .NET8
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Dec 9, 2023
1 parent c9d7eaa commit 3d20b38
Show file tree
Hide file tree
Showing 11 changed files with 368 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Cake.Frosting.Issues.Recipe.xml</DocumentationFile>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
Expand Down
118 changes: 117 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ jobs:
- task: UseDotNet@2
inputs:
version: '5.x'
displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- powershell: ./build.ps1
displayName: 'Build'
- publish: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
Expand All @@ -40,6 +47,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -70,6 +78,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand All @@ -90,6 +99,37 @@ jobs:
- publish: $(Build.SourcesDirectory)/tests/frosting/net7.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting Windows 2022 (.NET 7)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Frosting Windows (.NET 8)
- job: Test_Frosting_Windows_2022_Net8
displayName: Integration Tests Frosting Windows 2022 (.NET 8)
dependsOn: Build
pool:
vmImage: 'windows-2022'
steps:
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install NodeJs 14.x'
- powershell: choco install markdownlint-cli --no-progress
displayName: 'Install required tools'
- download: current
artifact: NuGet Package
displayName: 'Download build artifact'
- task: CopyFiles@2
inputs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
- powershell: ./build.ps1 --verbosity=diagnostic
workingDirectory: ./tests/frosting/net8.0
displayName: 'Run integration tests'
- publish: $(Build.SourcesDirectory)/tests/frosting/net8.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting Windows 2022 (.NET 8)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Script Runner Windows 2019 (.NET Core tool)
- job: Test_Script_Runner_Windows_2019_DotNetCoreTool
displayName: Integration Tests Script Runner Windows 2019 (.NET Core tool)
Expand All @@ -100,6 +140,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -130,6 +171,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -160,6 +202,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -192,6 +235,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand All @@ -214,6 +258,39 @@ jobs:
- publish: $(Build.SourcesDirectory)/tests/frosting/net7.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting macOS 12 (.NET 7)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Frosting macOS 12 (.NET 8)
- job: Test_Frosting_macOS_12_Net8
displayName: Integration Tests Frosting macOS 12 (.NET 8)
dependsOn: Build
pool:
vmImage: 'macOS-12'
steps:
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install NodeJs 14.x'
- bash: |
npm install -g markdownlint-cli
displayName: 'Install required tools'
- download: current
artifact: NuGet Package
displayName: 'Download build artifact'
- task: CopyFiles@2
inputs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
- bash: |
./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net8.0
displayName: 'Run integration tests'
- publish: $(Build.SourcesDirectory)/tests/frosting/net8.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting macOS 12 (.NET 8)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Script Runner macOS 11 (.NET Core tool)
- job: Test_Script_Runner_macOS_11_DotNetCoreTool
displayName: Integration Tests Script Runner macOS 11 (.NET Core tool)
Expand All @@ -224,6 +301,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -256,6 +334,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -288,6 +367,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand All @@ -311,7 +391,7 @@ jobs:
artifact: Integration Tests Frosting Ubuntu 20.04 (.NET 6)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Frosting Ubuntu 22.04 (.NET 7)
- job: Test_Frosting_ubuntu_2204_Net6
- job: Test_Frosting_ubuntu_2204_Net7
displayName: Integration Tests Frosting Ubuntu 22.04 (.NET 7)
dependsOn: Build
pool:
Expand All @@ -320,6 +400,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand All @@ -342,6 +423,39 @@ jobs:
- publish: $(Build.SourcesDirectory)/tests/frosting/net7.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting Ubuntu 22.04 (.NET 7)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Frosting Ubuntu 22.04 (.NET 8)
- job: Test_Frosting_ubuntu_2204_Net8
displayName: Integration Tests Frosting Ubuntu 22.04 (.NET 8)
dependsOn: Build
pool:
vmImage: 'ubuntu-22.04'
steps:
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install NodeJs 14.x'
- bash: |
npm install -g markdownlint-cli
displayName: 'Install required tools'
- download: current
artifact: NuGet Package
displayName: 'Download build artifact'
- task: CopyFiles@2
inputs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
- bash: |
./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net8.0
displayName: 'Run integration tests'
- publish: $(Build.SourcesDirectory)/tests/frosting/net8.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting Ubuntu 22.04 (.NET 8)
displayName: 'Publish generated reports as build artifact'
# Integration Tests Script Runner Ubuntu 20.04 (.NET Core tool)
- job: Test_Script_Runner_ubuntu_2004_DotNetCoreTool
displayName: Integration Tests Script Runner Ubuntu 20.04 (.NET Core tool)
Expand All @@ -352,6 +466,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down Expand Up @@ -384,6 +499,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: NodeTool@0
inputs:
versionSpec: '14.x'
Expand Down
13 changes: 13 additions & 0 deletions tests/frosting/net8.0/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$RECIPE_PACKAGE_PATH = "packages/cake.frosting.issues.recipe"
if (Test-Path $RECIPE_PACKAGE_PATH)
{
Write-Host "Cleaning up cached version of $RECIPE_PACKAGE_PATH..."
Remove-Item $RECIPE_PACKAGE_PATH -Recurse;
}
else
{
Write-Host "$RECIPE_PACKAGE_PATH not cached..."
}

dotnet run --project build/Build.csproj -- $args
exit $LASTEXITCODE;
11 changes: 11 additions & 0 deletions tests/frosting/net8.0/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

$RECIPE_PACKAGE_PATH = "packages/cake.frosting.issues.recipe"
if [ -d "$RECIPE_PACKAGE_PATH" ]
then
echo "Cleaning up cached version of $RECIPE_PACKAGE_PATH..."
rm -Rf $RECIPE_PACKAGE_PATH
else
echo "$RECIPE_PACKAGE_PATH not cached..."
fi

dotnet run --project ./build/Build.csproj -- "$@"
2 changes: 2 additions & 0 deletions tests/frosting/net8.0/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Cake ###
tools/*
11 changes: 11 additions & 0 deletions tests/frosting/net8.0/build/Build.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
<PackageReference Include="Cake.Frosting.Issues.Recipe" Version="*-*" />
</ItemGroup>
</Project>
Loading

0 comments on commit 3d20b38

Please sign in to comment.