From c72dcc0ae516810f8e8d23778d6a091d29b59c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Sch=C3=B6ne?= Date: Wed, 29 Mar 2023 12:45:30 +0200 Subject: [PATCH] Replacing PS-Script and Switch to Ubuntu Seperate Integration and Unit Tests Build and Pack Step with versioning Documentation-step with action Deleting PowerShell-dependencies --- .build/BuildToolkit.ps1 | 680 ------------------ .build/Common.props | 31 - .build/Output.ps1 | 36 - .build/moryx-logo.png | Bin 8400 -> 0 bytes .github/workflows/build-and-test-tool.yml | 118 ++- .github/workflows/build-tool.yml | 91 ++- .github/workflows/documentation-tool.yml | 37 +- .github/workflows/integrationtest-tool.yml | 42 +- .../workflows/publish-test-coverage-tool.yml | 15 - .github/workflows/publish-tool.yml | 79 +- .github/workflows/reportgenerator-tool.yml | 21 +- .github/workflows/unittest-tool.yml | 22 +- 12 files changed, 193 insertions(+), 979 deletions(-) delete mode 100644 .build/BuildToolkit.ps1 delete mode 100644 .build/Common.props delete mode 100644 .build/Output.ps1 delete mode 100644 .build/moryx-logo.png diff --git a/.build/BuildToolkit.ps1 b/.build/BuildToolkit.ps1 deleted file mode 100644 index 26d22db..0000000 --- a/.build/BuildToolkit.ps1 +++ /dev/null @@ -1,680 +0,0 @@ -# Tool Versions -$NunitVersion = "3.12.0"; -$OpenCoverVersion = "4.7.1221"; -$DocFxVersion = "2.58.4"; -$ReportGeneratorVersion = "4.8.13"; -$OpenCoverToCoberturaVersion = "0.3.4"; - -# Folder Pathes -$RootPath = $MyInvocation.PSScriptRoot; -$BuildTools = "$RootPath\packages"; - -# Artifacts -$ArtifactsDir = "$RootPath\artifacts"; - -# Documentation -$DocumentationDir = "$RootPath\docs"; -$DocumentationArtifcacts = "$ArtifactsDir\Documentation"; - -# Tests -$NunitReportsDir = "$ArtifactsDir\Tests"; -$OpenCoverReportsDir = "$ArtifactsDir\Tests" -$CoberturaReportsDir = "$ArtifactsDir\Tests" - -# Nuget -$NugetConfig = "$RootPath\NuGet.Config"; -$NugetPackageArtifacts = "$ArtifactsDir\Packages"; - -# Load partial scripts -. "$PSScriptRoot\Output.ps1"; - -# Define Tools -$global:DotNetCli = "dotnet.exe"; -$global:NugetCli = "nuget.exe"; -$global:GitCli = ""; -$global:OpenCoverCli = "$BuildTools\OpenCover.$OpenCoverVersion\tools\OpenCover.Console.exe"; -$global:NunitCli = "$BuildTools\NUnit.ConsoleRunner.$NunitVersion\tools\nunit3-console.exe"; -$global:ReportGeneratorCli = "$BuildTools\ReportGenerator.$ReportGeneratorVersion\tools\net47\ReportGenerator.exe"; -$global:DocFxCli = "$BuildTools\docfx.console.$DocFxVersion\tools\docfx.exe"; -$global:OpenCoverToCoberturaCli = "$BuildTools\OpenCoverToCoberturaConverter.$OpenCoverToCoberturaVersion\tools\OpenCoverToCoberturaConverter.exe"; - -# Git -$global:GitCommitHash = ""; - -# Functions -function Invoke-Initialize([string]$Version = "1.0.0", [bool]$Cleanup = $False) { - Write-Step "Initializing BuildToolkit" - - # First check the powershell version - if ($PSVersionTable.PSVersion.Major -lt 5) { - Write-Host ("The needed major powershell version for this script is 5. Your version: " + ($PSVersionTable.PSVersion.ToString())) - exit 1; - } - - # Assign git.exe - $gitCommand = (Get-Command "git.exe" -ErrorAction SilentlyContinue); - if ($null -eq $gitCommand) { - Write-Host "Unable to find git.exe in your PATH. Download from https://git-scm.com"; - exit 1; - } - - $global:GitCli = $gitCommand.Path; - - # Load Hash - $global:GitCommitHash = (& $global:GitCli rev-parse HEAD); - Invoke-ExitCodeCheck $LastExitCode; - - # Initialize Folders - CreateFolderIfNotExists $BuildTools; - CreateFolderIfNotExists $ArtifactsDir; - - # Environment Variable Defaults - if (-not $env:MORYX_BUILDNUMBER) { - $env:MORYX_BUILDNUMBER = 0; - } - - if (-not $env:MORYX_BUILD_CONFIG) { - $env:MORYX_BUILD_CONFIG = "Debug"; - } - - if (-not $env:MORYX_BUILD_VERBOSITY) { - $env:MORYX_BUILD_VERBOSITY = "minimal" - } - - if (-not $env:MORYX_TEST_VERBOSITY) { - $env:MORYX_TEST_VERBOSITY = "normal" - } - - if (-not $env:MORYX_NUGET_VERBOSITY) { - $env:MORYX_NUGET_VERBOSITY = "normal" - } - - if (-not $env:MORYX_OPTIMIZE_CODE) { - $env:MORYX_OPTIMIZE_CODE = $True; - } - else { - if (-not [bool]::TryParse($env:MORYX_OPTIMIZE_CODE, [ref]$env:MORYX_OPTIMIZE_CODE)) { - $env:MORYX_OPTIMIZE_CODE = $True; - } - } - - if (-not $env:MORYX_PACKAGE_TARGET) { - $env:MORYX_PACKAGE_TARGET = ""; - } - - if (-not $env:MORYX_PACKAGE_TARGET_V3) { - $env:MORYX_PACKAGE_TARGET_V3 = ""; - } - - if (-not $env:MORYX_ASSEMBLY_VERSION) { - $env:MORYX_ASSEMBLY_VERSION = $Version; - } - - if (-not $env:MORYX_FILE_VERSION) { - $env:MORYX_FILE_VERSION = $Version; - } - - if (-not $env:MORYX_INFORMATIONAL_VERSION) { - $env:MORYX_INFORMATIONAL_VERSION = $Version; - } - - if (-not $env:MORYX_PACKAGE_VERSION) { - $env:MORYX_PACKAGE_VERSION = $Version; - } - - Set-Version $Version; - - # Printing Variables - Write-Step "Printing global variables" - Write-Variable "RootPath" $RootPath; - Write-Variable "DocumentationDir" $DocumentationDir; - Write-Variable "NunitReportsDir" $NunitReportsDir; - - Write-Step "Printing global scope" - Write-Variable "OpenCoverCli" $global:OpenCoverCli; - Write-Variable "NUnitCli" $global:NUnitCli; - Write-Variable "ReportGeneratorCli" $global:ReportGeneratorCli; - Write-Variable "DocFxCli" $global:DocFxCli; - Write-Variable "OpenCoverToCoberturaCli" $global:OpenCoverToCoberturaCli; - Write-Variable "GitCli" $global:GitCli; - Write-Variable "GitCommitHash" $global:GitCommitHash; - - Write-Step "Printing environment variables" - Write-Variable "MORYX_OPTIMIZE_CODE" $env:MORYX_OPTIMIZE_CODE; - Write-Variable "MORYX_BUILDNUMBER" $env:MORYX_BUILDNUMBER; - Write-Variable "MORYX_BUILD_CONFIG" $env:MORYX_BUILD_CONFIG; - Write-Variable "MORYX_BUILD_VERBOSITY" $env:MORYX_BUILD_VERBOSITY; - Write-Variable "MORYX_TEST_VERBOSITY" $env:MORYX_TEST_VERBOSITY; - Write-Variable "MORYX_NUGET_VERBOSITY" $env:MORYX_NUGET_VERBOSITY; - Write-Variable "MORYX_PACKAGE_TARGET" $env:MORYX_PACKAGE_TARGET; - Write-Variable "MORYX_PACKAGE_TARGET_V3" $env:MORYX_PACKAGE_TARGET_V3; - - Write-Variable "MORYX_ASSEMBLY_VERSION" $env:MORYX_ASSEMBLY_VERSION; - Write-Variable "MORYX_FILE_VERSION" $env:MORYX_FILE_VERSION; - Write-Variable "MORYX_INFORMATIONAL_VERSION" $env:MORYX_INFORMATIONAL_VERSION; - Write-Variable "MORYX_PACKAGE_VERSION" $env:MORYX_PACKAGE_VERSION; - - - # Cleanp - if ($Cleanup) { - Write-Step "Cleanup" - - Write-Host "Cleaning up repository ..." -ForegroundColor Red; - & $global:GitCli clean -f -d -x - Invoke-ExitCodeCheck $LastExitCode; - - & $global:GitCli checkout . - Invoke-ExitCodeCheck $LastExitCode; - } -} - -function Invoke-Cleanup { - # Clean up - Write-Step "Cleaning up repository ..."; - & $global:GitCli clean -f -d -x - Invoke-ExitCodeCheck $LastExitCode; -} - -function Install-Tool([string]$PackageName, [string]$Version, [string]$TargetExecutable, [string]$OutputDirectory = $BuildTools) { - if (-not (Test-Path $TargetExecutable)) { - & $global:NugetCli install $PackageName -version $Version -outputdirectory $OutputDirectory -configfile $NugetConfig - Invoke-ExitCodeCheck $LastExitCode; - } - else { - Write-Host "$PackageName ($Version) already exists. Do not need to install." - } -} - -function Invoke-Build([string]$ProjectFile, [string]$Options = "") { - Write-Step "Building $ProjectFile" - - # TODO: maybe we find a better way: currently all packages of all solutions are restored. - ForEach ($solution in (Get-ChildItem $RootPath -Filter "*.sln")) { - Write-Host "Restoring Nuget packages of $solution"; - - & $global:DotNetCli restore $solution --verbosity $env:MORYX_NUGET_VERBOSITY --configfile $NugetConfig; - Invoke-ExitCodeCheck $LastExitCode; - } - - $additonalOptions = ""; - if (-not [string]::IsNullOrEmpty($Options)) { - $additonalOptions = ",$Options"; - } - - $msbuildParams = "Optimize=" + (&{If($env:MORYX_OPTIMIZE_CODE -eq $True) {"true"} Else {"false"}}) + ",DebugSymbols=true$additonalOptions"; - $buildArgs = "--configuration", "$env:MORYX_BUILD_CONFIG"; - $buildArgs += "--verbosity", $env:MORYX_BUILD_VERBOSITY; - $buildArgs += "-p:$msbuildParams" - - & $global:DotNetCli build $ProjectFile @buildArgs - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-Nunit([string]$SearchPath = $RootPath, [string]$SearchFilter = "*.csproj") { - $randomIncrement = Get-Random -Minimum 2000 -Maximum 2100 - Write-Step "Running $Name Tests: $SearchPath" - - $testProjects = Get-ChildItem $SearchPath -Recurse -Include $SearchFilter - if ($testProjects.Length -eq 0) { - Write-Host-Warning "No test projects found!" - return; - } - - $env:PORT_INCREMENT = $randomIncrement; - - if (-not (Test-Path $global:NUnitCli)) { - Install-Tool "NUnit.Console" $NunitVersion $global:NunitCli; - } - - CreateFolderIfNotExists $NunitReportsDir; - - ForEach($testProject in $testProjects ) { - $projectName = ([System.IO.Path]::GetFileNameWithoutExtension($testProject.Name)); - $testAssembly = [System.IO.Path]::Combine($testProject.DirectoryName, "bin", $env:MORYX_BUILD_CONFIG, "$projectName.dll"); - - # If assembly does not exists, the project will be build - if (-not (Test-Path $testAssembly)) { - Invoke-Build $testProject - } - - & $global:NUnitCli $testProject /config:"$env:MORYX_BUILD_CONFIG" - } - - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-SmokeTest([string]$RuntimePath, [int]$ModulesCount, [int]$InterruptTime) { - $randomIncrement = Get-Random -Minimum 2000 -Maximum 2100 - Write-Step "Invoking Runtime SmokeTest Modules: $ModulesCount, Interrupt Time: $InterruptTime, Port Increment: $randomIncrement." - - & "$RuntimePath" @("smokeTest", "-e $ModulesCount", "-i $InterruptTime", "-p $randomIncrement") - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj", $FilterFile = "$RootPath\OpenCoverFilter.txt") { - Write-Step "Starting cover tests from $SearchPath with filter $FilterFile." - - if (-not (Test-Path $SearchPath)) { - Write-Host-Warning "$SearchPath does not exists, ignoring!"; - return; - } - - $testProjects = Get-ChildItem $SearchPath -Recurse -Include $SearchFilter - if ($testProjects.Length -eq 0) { - Write-Host-Warning "No test projects found!" - return; - } - - if (-not (Test-Path $global:NUnitCli)) { - Install-Tool "NUnit.Console" $NunitVersion $global:NunitCli; - } - - if (-not (Test-Path $global:OpenCoverCli)) { - Install-Tool "OpenCover" $OpenCoverVersion $global:OpenCoverCli; - } - - if (-not (Test-Path $global:OpenCoverToCoberturaCli)) { - Install-Tool "OpenCoverToCoberturaConverter" $OpenCoverToCoberturaVersion $global:OpenCoverToCoberturaCli; - } - - CreateFolderIfNotExists $OpenCoverReportsDir; - CreateFolderIfNotExists $NunitReportsDir; - - $includeFilter = "+[Moryx*]*"; - $excludeFilter = "-[*nunit*]* -[*Tests]* -[*Model*]*"; - - if (Test-Path $FilterFile) { - $ignoreContent = Get-Content $FilterFile; - - foreach ($line in $ignoreContent) { - $parts = $line.Split(":"); - if ($parts.Count -lt 2) { - continue - } - - $filterType = $parts[0]; - $filterValue = $parts[1]; - - if ($filterType.StartsWith("INCLUDE")) { - $includeFilter += " $filterValue"; - } - - if ($filterType.StartsWith("EXCLUDE")) { - $excludeFilter += " $filterValue"; - } - } - - Write-Host "Active Filter: `r`n Include: $includeFilter `r`n Exclude: $excludeFilter"; - } - - ForEach($testProject in $testProjects ) { - $projectName = ([System.IO.Path]::GetFileNameWithoutExtension($testProject.Name)); - $testAssembly = [System.IO.Path]::Combine($testProject.DirectoryName, "bin", $env:MORYX_BUILD_CONFIG, "$projectName.dll"); - $isNetCore = Get-CsprojIsNetCore($testProject); - - Write-Host "OpenCover Test: ${projectName}:"; - - $nunitXml = ($NunitReportsDir + "\$projectName.TestResult.xml"); - $openCoverXml = ($OpenCoverReportsDir + "\$projectName.OpenCover.xml"); - $coberturaXml = ($CoberturaReportsDir + "\$projectName.Cobertura.xml"); - - if ($isNetCore) { - $targetArgs = '"test -v ' + $env:MORYX_TEST_VERBOSITY + ' -c ' + $env:MORYX_BUILD_CONFIG + ' ' + $testProject + '"'; - $openCoverAgs = "-target:$global:DotNetCli", "-targetargs:$targetArgs" - } - else { - # If assembly does not exists, the project will be build - if (-not (Test-Path $testAssembly)) { - Invoke-Build $testProject - } - - $openCoverAgs = "-target:$global:NunitCli", "-targetargs:/config:$env:MORYX_BUILD_CONFIG /result:$nunitXml $testAssembly" - } - - $openCoverAgs += "-log:Debug", "-register:administrator", "-output:$openCoverXml", "-hideskipped:all", "-skipautoprops"; - $openCoverAgs += "-returntargetcode" # We need the nunit return code - $openCoverAgs += "-filter:$includeFilter $excludeFilter" - - & $global:OpenCoverCli $openCoverAgs - - $exitCode = [int]::Parse($LastExitCode); - if ($exitCode -ne 0) { - $errorText = ""; - switch ($exitCode) { - -1 { $errorText = "INVALID_ARG"; } - -2 { $errorText = "INVALID_ASSEMBLY"; } - -4 { $errorText = "INVALID_TEST_FIXTURE"; } - -5 { $errorText = "UNLOAD_ERROR"; } - Default { $errorText = "UNEXPECTED_ERROR"; } - } - - if ($exitCode -gt 0) { - $errorText = "FAILED_TESTS ($exitCode)"; - } - - Write-Host-Error "Nunit exited with $errorText for $projectName"; - Invoke-ExitCodeCheck $exitCode; - } - - & $global:OpenCoverToCoberturaCli -input:$openCoverXml -output:$coberturaXml -sources:$rootPath - Invoke-ExitCodeCheck $LastExitCode; - } -} - -function Get-CsprojIsNetCore($CsprojItem) { - [xml]$csprojContent = Get-Content $CsprojItem.FullName - $sdkProject = $csprojContent.Project.Sdk; - if ($null -ne $sdkProject) { - # Read Target Framework - $targetFramework = $csprojContent.Project.PropertyGroup.TargetFramework; - if ($targetFramework -Match "netcoreapp" -or $targetFramework -Match "net5.") { - # NETCore - return $true; - } - } - return $false; -} - -function Get-CsprojIsSdkProject($CsprojItem) { - [xml]$csprojContent = Get-Content $CsprojItem.FullName - $sdkProject = $csprojContent.Project.Sdk; - if ($null -ne $sdkProject) { - return $true; - } - return $false; -} - -function Invoke-CoverReport { - Write-Step "Creating cover report. Searching for OpenCover.xml files in $OpenCoverReportsDir." - - if (-not (Test-Path $OpenCoverReportsDir)) { - Write-Host-Error "$OpenCoverReportsDir was not found!"; - Invoke-ExitCodeCheck 1; - } - - if (-not (Test-Path $global:ReportGeneratorCli)) { - Install-Tool "ReportGenerator" $ReportGeneratorVersion $global:ReportGeneratorCli; - } - - $reports = (Get-ChildItem $OpenCoverReportsDir -Recurse -Include '*.OpenCover.xml'); - $asArgument = [string]::Join(";",$reports); - - CreateFolderIfNotExists $DocumentationArtifcacts; - - & $global:ReportGeneratorCli -reports:"$asArgument" -targetDir:"$DocumentationArtifcacts/OpenCover" - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-DocFx($Metadata = [System.IO.Path]::Combine($DocumentationDir, "docfx.json")) { - Write-Step "Generating documentation using DocFx" - - if (-not (Test-Path $Metadata)) { - Write-Host-Error "Metadata was not found at: $Metadata!" - Invoke-ExitCodeCheck 1; - } - - if (-not (Test-Path $global:DocFxCli)) { - Install-Tool "docfx.console" $DocFxVersion $global:DocFxCli; - } - - $docFxObj = (Get-Content $Metadata) | ConvertFrom-Json; - $metadataFolder = [System.IO.Path]::GetDirectoryName($Metadata); - $docFxDest = [System.IO.Path]::Combine($metadataFolder, $docFxObj.build.dest); - - & $global:DocFxCli $Metadata; - Invoke-ExitCodeCheck $LastExitCode; - - CreateFolderIfNotExists $DocumentationArtifcacts; - CopyAndReplaceFolder $docFxDest "$DocumentationArtifcacts\DocFx"; -} - -function Invoke-PackSdkProject($CsprojItem, [bool]$IncludeSymbols = $False) { - Write-Host "Try to pack .NET SDK project: $($CsprojItem.Name) ..."; - - # Check if the project should be packed - $csprojFullName = $CsprojItem.FullName; - [xml]$csprojContent = Get-Content $csprojFullName - $createPackage = $csprojContent.Project.PropertyGroup.CreatePackage; -; - if ($null -eq $createPackage -or "false" -eq $createPackage) { - Write-Host-Warning "... csproj not flagged with true: $($CsprojItem.Name)"; - return; - } - - $packargs = "--output", "$NugetPackageArtifacts"; - $packargs += "--configuration", "$env:MORYX_BUILD_CONFIG"; - $packargs += "--verbosity", "$env:MORYX_NUGET_VERBOSITY"; - $packargs += "--no-build"; - - if ($IncludeSymbols) { - $packargs += "--include-symbols"; - $packargs += "--include-source"; - } - - & $global:DotNetCli pack "$csprojFullName" @packargs - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-PackFrameworkProject($CsprojItem, [bool]$IsTool = $False, [bool]$IncludeSymbols = $False) { - Write-Host "Try to pack .NET Framework project: $CsprojItem.Name ..."; - - # Check if there is a matching nuspec for the proj - $csprojFullName = $CsprojItem.FullName; - $nuspecPath = [IO.Path]::ChangeExtension($csprojFullName, "nuspec") - if(-not (Test-Path $nuspecPath)) { - Write-Host-Warning "Nuspec for project not found: $CsprojItem.Name"; - return; - } - - $packargs = "-outputdirectory", "$NugetPackageArtifacts"; - $packargs += "-includereferencedprojects"; - $packargs += "-Version", "$env:MORYX_PACKAGE_VERSION"; - $packargs += "-Prop", "Configuration=$env:MORYX_BUILD_CONFIG"; - $packargs += "-Verbosity", "$env:MORYX_NUGET_VERBOSITY"; - - if ($IncludeSymbols) { - $packargs += "-Symbols"; - } - - if ($IsTool) { - $packargs += "-Tool"; - } - - # Call nuget with default arguments plus optional - & $global:NugetCli pack "$csprojFullName" @packargs - Invoke-ExitCodeCheck $LastExitCode; -} - -function Invoke-Pack($ProjectItem, [bool]$IsTool = $False, [bool]$IncludeSymbols = $False) { - CreateFolderIfNotExists $NugetPackageArtifacts; - - if (Get-CsprojIsSdkProject($ProjectItem)) { - Invoke-PackSdkProject $ProjectItem $IncludeSymbols; - } - else { - Invoke-PackFrameworkProject $ProjectItem $IsTool $IncludeSymbols; - } -} - -function Invoke-PackAll([switch]$Symbols = $False) { - Write-Host "Looking for .csproj files..." - # Look for csproj in this directory - foreach ($csprojItem in Get-ChildItem $RootPath -Recurse -Filter *.csproj) { - Invoke-Pack -ProjectItem $csprojItem -IncludeSymbols $Symbols - } -} - -function Invoke-Publish { - Write-Host "Pushing packages from $NugetPackageArtifacts to $env:MORYX_PACKAGE_TARGET" - - $packages = Get-ChildItem $NugetPackageArtifacts -Recurse -Include *.nupkg - if ($packages.Length -gt 0 -and [string]::IsNullOrEmpty($env:MORYX_PACKAGE_TARGET)) { - Write-Host-Error "There is no package target given. Set the environment varialble MORYX_PACKAGE_TARGET to publish packages."; - Invoke-ExitCodeCheck 1; - } - - foreach ($package in $packages) { - Write-Host "Pushing package $package" - & $global:DotNetCli nuget push $package --api-key $env:MORYX_NUGET_APIKEY --no-symbols --skip-duplicate --source $env:MORYX_PACKAGE_TARGET - Invoke-ExitCodeCheck $LastExitCode; - } - - $symbolPackages = Get-ChildItem $NugetPackageArtifacts -Recurse -Include *.snupkg - if ($symbolPackages.Length -gt 0 -and [string]::IsNullOrEmpty($env:MORYX_PACKAGE_TARGET_V3)) { - Write-Host-Error "There is no package (v3) target given. Set the environment varialble MORYX_PACKAGE_TARGET_V3 to publish snupkg symbol packages."; - Invoke-ExitCodeCheck 1; - } - - foreach ($symbolPackage in $symbolPackages) { - Write-Host "Pushing symbol (snupkg) $symbolPackage" - & $global:DotNetCli nuget push $symbolPackage --api-key $env:MORYX_NUGET_APIKEY --skip-duplicate --source $env:MORYX_PACKAGE_TARGET_V3 - Invoke-ExitCodeCheck $LastExitCode; - } -} - -function Set-Version ([string]$MajorMinorPatch) { - $semVer2Regex = "^(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"; - - $version = Read-VersionFromRef($MajorMinorPatch); - Write-Host "Setting environment version to $version"; - - # Match semVer2 regex - $regexMatch = [regex]::Match($version, $semVer2Regex); - - if (-not $regexMatch.Success) { - Write-Host "Could not parse version: $version"; - Invoke-ExitCodeCheck 1; - } - - # Extract groups - $matchgroups = $regexMatch.captures.groups; - $majorGroup = $matchgroups[1]; - $minorGroup = $matchgroups[2]; - $patchGroup = $matchgroups[3]; - $preReleaseGroup = $matchgroups[4]; - - # Compose Major.Minor.Patch - $mmp = $majorGroup.Value + "." + $minorGroup.Value + "." + $patchGroup.Value; - - # Check if it is a pre release - $env:MORYX_ASSEMBLY_VERSION = $majorGroup.Value + ".0.0.0" # 3.0.0.0 - $env:MORYX_FILE_VERSION = $mmp + "." + $env:MORYX_BUILDNUMBER; # 3.1.2.42 - - if ($preReleaseGroup.Success) { - $env:MORYX_INFORMATIONAL_VERSION = $mmp + "-" + $preReleaseGroup.Value + "+" + $global:GitCommitHash; # 3.1.2-beta.1+d95a996ed5ba14a1421dafeb844a56ab08211ead - $env:MORYX_PACKAGE_VERSION = $mmp + "-" + $preReleaseGroup.Value; - } else { - $env:MORYX_INFORMATIONAL_VERSION = $mmp + "+" + $global:GitCommitHash; # 3.1.2+d95a996ed5ba14a1421dafeb844a56ab08211ead - $env:MORYX_PACKAGE_VERSION = $mmp; - } -} - -function Read-VersionFromRef([string]$MajorMinorPatch) { - function preReleaseVersion ([string] $name) - { - $name = $name.Replace("/","").ToLower(); - return "$MajorMinorPatch-$name.$env:MORYX_BUILDNUMBER";; - } - - $ref = ""; - if ($env:GITHUB_WORKFLOW) { # GitHub Workflow - Write-Host "Reading version from 'GitHub Workflow'"; - $ref = $env:GITHUB_REF; - - if ($ref.StartsWith("refs/tags/")) { - if ($ref.StartsWith("refs/tags/v")) { - # Its a version tag - $version = $ref.Replace("refs/tags/v","") - } - else { - # Just a tag - $name = $ref.Replace("refs/tags/",""); - $version = = preReleaseVersion($name); - } - } - elseif ($ref.StartsWith("refs/heads/")) { - # Its a branch - $name = $ref.Replace("refs/heads/",""); - $version = preReleaseVersion($name); - } - else { - $version = preReleaseVersion($ref); - } - } - else { # Local build - Write-Host "Reading version from 'local'"; - $ref = (& $global:GitCli rev-parse --abbrev-ref HEAD); - $version = preReleaseVersion($ref); - } - - return $version; -} - -function Set-AssemblyVersion([string]$InputFile) { - $file = Get-Childitem -Path $inputFile; - - if (-Not $file) { - Write-Host "AssemblyInfo: $inputFile was not found!"; - exit 1; - } - - Write-Host "Applying assembly info of $($file.FullName) -> $env:MORYX_ASSEMBLY_VERSION "; - - $assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+)){3}"\)'; - $assemblyVersion = 'AssemblyVersion("' + $env:MORYX_ASSEMBLY_VERSION + '")'; - - $assemblyFileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+)){3}"\)'; - $assemblyFileVersion = 'AssemblyFileVersion("' + $env:MORYX_FILE_VERSION + '")'; - - $assemblyInformationalVersionPattern = 'AssemblyInformationalVersion\("[0-9]+(\.([0-9]+)){3}"\)'; - $assemblyInformationalVersion = 'AssemblyInformationalVersion("' + $env:MORYX_INFORMATIONAL_VERSION + '")'; - - $assemblyConfigurationPattern = 'AssemblyConfiguration\("\w+"\)'; - $assemblyConfiguration = 'AssemblyConfiguration("' + $env:MORYX_BUILD_CONFIG + '")'; - - $content = (Get-Content $file.FullName) | ForEach-Object { - ForEach-Object {$_ -replace $assemblyVersionPattern, $assemblyVersion } | - ForEach-Object {$_ -replace $assemblyFileVersionPattern, $assemblyFileVersion } | - ForEach-Object {$_ -replace $assemblyInformationalVersionPattern, $assemblyInformationalVersion } | - ForEach-Object {$_ -replace $assemblyConfigurationPattern, $assemblyConfiguration } - } - - Out-File -InputObject $content -FilePath $file.FullName -Encoding utf8; -} - -function Set-AssemblyVersions([string[]]$Ignored = $(), [string]$SearchPath = $RootPath) { - $Ignored = $Ignored + "\\.build\\" + "\\Tests\\" + "\\IntegrationTests\\" + "\\SystemTests\\"; - - $assemblyInfos = Get-ChildItem -Path $RootPath -include "*AssemblyInfo.cs" -Recurse | Where-Object { - $fullName = $_.FullName; - return -not ($Ignored.Where({ $fullName -match $_ }).Count -gt 0); - } - - if ($assemblyInfos) - { - Write-Host "Will apply version to $($assemblyInfos.Count) AssemblyInfos."; - foreach ($file in $assemblyInfos) { - Set-AssemblyVersion -InputFile $file; - } - } -} - -function CreateFolderIfNotExists([string]$Folder) { - if (-not (Test-Path $Folder)) { - Write-Host "Creating missing directory '$Folder'" - New-Item $Folder -Type Directory | Out-Null - } -} - -function CopyAndReplaceFolder($SourceDir, $TargetDir) { - Write-Host-Info "Copy $SourceDir to $TargetDir!" - # Remove old folder if exists - if (Test-Path $TargetDir) { - Write-Host "Target path already exists, removing ..." -ForegroundColor Yellow - Remove-Item -Recurse -Force $TargetDir - } - - # Copy to target path - Write-Host "Copy from $SourceDir to $TargetDir ..." -ForegroundColor Green - Copy-Item -Path $SourceDir -Recurse -Destination $TargetDir -Container -} diff --git a/.build/Common.props b/.build/Common.props deleted file mode 100644 index d5b059b..0000000 --- a/.build/Common.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - 0.0.0 - $(MORYX_ASSEMBLY_VERSION) - - 0.0.0.0 - $(MORYX_FILE_VERSION) - - 0.0.0.0 - $(MORYX_INFORMATIONAL_VERSION) - - 0.0.0 - $(MORYX_PACKAGE_VERSION) - - PHOENIXCONTACT - PHOENIX CONTACT - MORYX - - $([System.DateTime]::Now.ToString("yyyy")) - Copyright © PHOENIX CONTACT $(CurrentYear) - - moryx-logo.png - https://moryx-industry.net/ - - - - - - - \ No newline at end of file diff --git a/.build/Output.ps1 b/.build/Output.ps1 deleted file mode 100644 index 913f557..0000000 --- a/.build/Output.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -################################ -# Functions for Console Output # -################################ - -function Write-Step([string]$step) { - Write-Host "########################################################################################################" -foreground Magenta; - Write-Host "#### $step" -foreground Magenta; - Write-Host "########################################################################################################" -foreground Magenta -} - -function Write-Variable ([string]$variableName, [string]$variableValue) { - Write-Host ($variableName + " = " + $variableValue) -} - -function Invoke-ExitCodeCheck([string]$exitCode) { - if ([int]::Parse($exitCode) -gt 0) { - Write-Host "This is the end, you know (ExitCode: $exitCode) - Lady, the plans we had went all wrong - We ain't nothing but fight and shout and tears." -ForegroundColor Red - exit $exitCode; - } -} - -function Write-Host-Info([string]$message) { - Write-Host $message -} - -function Write-Host-Success([string]$message) { - Write-Host $message -ForegroundColor Green -} - -function Write-Host-Warning([string]$message) { - Write-Host $message -ForegroundColor Yellow -} - -function Write-Host-Error([string]$message) { - Write-Host $message -ForegroundColor Red -} \ No newline at end of file diff --git a/.build/moryx-logo.png b/.build/moryx-logo.png deleted file mode 100644 index 5d9def69c7b8f00b22053e35541766e58d7af220..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8400 zcmbt(cQjnl*Y-7f7bSX)nh*p*^h6gVM33Iv=$$d5mnb1b7rlk(y@e2h5j}|Bq74Rv zVZ4*yx4!@1a@V?LJ!hYD&%Ni_``PE5*jHLAq(lrv005AxsVeFK02byE_)7r7Tow5t zFwBk6UDe170EnsnomfCt4jl%>_g2$X!rvsqrDEbe8AI^>2U0ThR`Bt5aPtHzYDQHt z5Q#SiQndB5_H=ajc60*+RD|pgFgVda{Dqr)fTyFqgEvr3KKcxUlKltuw6*+a%I59p zY72-V$q6wfg#Su(-R!*mEIn-jQ}?@n=EVPL+|kS0#S&xc3AFS!CShQLf3Sh2C)g2e z5A-r_M`JMj|5x9~)7lm|zYE|0|7I`TTwQI!-oV9ZdJhJ}`)BsX(c8rqC_kFy0RYx) zHARIt{yB%a0XfuLnM3(4mDgEobYKdKZ(IbP57~Bvut_Kk#fRTDiH~ z_w2^%_Od>epWL_d6-TN0dbNVag+_&zur?_ua1_9=ELt;<_G$uGZi_m~s;ZV-u0P3E zR_vhGHp;4z0aaB&%PY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kJfV30JcWQXI`wGj zIF==U?$OT#b5r-7&eUN%l4C;mKWtQ>FSkMQ0D+ME*D~vbD{A^Qs2VWHombW|LT)6Q6ctbnu4&N~#O>*^s RnG?VqYD!v)HP0>H{TKH53&#Ke diff --git a/.github/workflows/build-and-test-tool.yml b/.github/workflows/build-and-test-tool.yml index f276f12..300de10 100644 --- a/.github/workflows/build-and-test-tool.yml +++ b/.github/workflows/build-and-test-tool.yml @@ -12,94 +12,88 @@ on: branches: - dev - future - + env: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true REPOSITORY_NAME: ${{ github.event.repository.name }} + MORYX_PACKAGE_TARGET_DEV: 'https://www.myget.org/F/moryx/api/v2/package' + MORYX_PACKAGE_TARGET_V3_DEV: 'https://www.myget.org/F/moryx/api/v3/index.json' + MORYX_PACKAGE_TARGET_FUTURE: 'https://www.myget.org/F/moryx-future/api/v2/package' + MORYX_PACKAGE_TARGET_V3_FUTURE: 'https://www.myget.org/F/moryx-future/api/v3/index.json' + MORYX_PACKAGE_TARGET_RELEASE: 'https://api.nuget.org/v3/index.json' + MORYX_PACKAGE_TARGET_V3_RELEASE: 'https://api.nuget.org/v3/index.json' jobs: + EnvVar: + runs-on: ubuntu-latest + steps: + - run: echo "" + outputs: + dotnet_sdk_version: ${{ env.dotnet_sdk_version }} + REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }} + MORYX_PACKAGE_TARGET_DEV: ${{ env.MORYX_PACKAGE_TARGET_DEV }} + MORYX_PACKAGE_TARGET_V3_DEV: ${{ env.MORYX_PACKAGE_TARGET_V3_DEV }} + MORYX_PACKAGE_TARGET_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_FUTURE }} + MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ env.MORYX_PACKAGE_TARGET_V3_FUTURE }} + MORYX_PACKAGE_TARGET_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_RELEASE }} + MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ env.MORYX_PACKAGE_TARGET_V3_RELEASE }} + Build: - uses: PHOENIXCONTACT/tools/.github/workflows/build-tool.yml@main + needs: [EnvVar] + uses: phoenixcontact/tools/.github/workflows/build-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} UnitTests: - needs: [Build] - uses: PHOENIXCONTACT/tools/.github/workflows/unittest-tool.yml@main + needs: [EnvVar, Build] + uses: phoenixcontact/tools/.github/workflows/unittest-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} IntegrationTests: - needs: [Build] - uses: PHOENIXCONTACT/tools/.github/workflows/integrationtest-tool.yml@main + needs: [EnvVar, Build] + uses: phoenixcontact/tools/.github/workflows/integrationtest-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} ReportGenerator: - needs: [UnitTests, IntegrationTests] - uses: PHOENIXCONTACT/tools/.github/workflows/reportgenerator-tool.yml@main + needs: [EnvVar, UnitTests, IntegrationTests] + uses: phoenixcontact/tools/.github/workflows/reportgenerator-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} Publish-Test-Coverage: - needs: [ReportGenerator] - uses: PHOENIXCONTACT/tools/.github/workflows/publish-test-coverage-tool.yml@main + needs: [EnvVar, ReportGenerator] + uses: phoenixcontact/tools/.github/workflows/publish-test-coverage-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} secrets: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - Documentation: - needs: [UnitTests] - uses: PHOENIXCONTACT/tools/.github/workflows/documentation-tool.yml@main - with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + # currently not working with .Net 8 and in Framework-repo + # Documentation: + # needs: [EnvVar, UnitTests] + # uses: phoenixcontact/tools/.github/workflows/documentation-tool.yml@main + # with: + # REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} Publish: - needs: [UnitTests] - uses: PHOENIXCONTACT/tools/.github/workflows/publish-tool.yml@main + needs: [EnvVar, UnitTests] + uses: phoenixcontact/tools/.github/workflows/publish-tool.yml@main with: - MORYX_OPTIMIZE_CODE: "false" - MORYX_BUILD_CONFIG: "Release" - MORYX_BUILDNUMBER: ${{github.run_number}} - dotnet_sdk_version: '7.x' - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - REPOSITORY_NAME: ${{ github.event.repository.name }} + dotnet_sdk_version: ${{ needs.EnvVar.outputs.dotnet_sdk_version }} + REPOSITORY_NAME: ${{ needs.EnvVar.outputs.REPOSITORY_NAME }} + MORYX_PACKAGE_TARGET_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_DEV }} + MORYX_PACKAGE_TARGET_V3_DEV: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_DEV }} + MORYX_PACKAGE_TARGET_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_FUTURE }} + MORYX_PACKAGE_TARGET_V3_FUTURE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_FUTURE }} + MORYX_PACKAGE_TARGET_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_RELEASE }} + MORYX_PACKAGE_TARGET_V3_RELEASE: ${{ needs.EnvVar.outputs.MORYX_PACKAGE_TARGET_V3_RELEASE }} secrets: MYGET_TOKEN: ${{secrets.MYGET_TOKEN}} NUGET_TOKEN: ${{secrets.NUGET_TOKEN}} + \ No newline at end of file diff --git a/.github/workflows/build-tool.yml b/.github/workflows/build-tool.yml index ab39858..b38d272 100644 --- a/.github/workflows/build-tool.yml +++ b/.github/workflows/build-tool.yml @@ -9,47 +9,80 @@ on: REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean - + jobs: Build: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Setup .NET SDK - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ inputs.dotnet_sdk_version }} + # - name: Setup .NET SDK + # uses: actions/setup-dotnet@v3 + # with: + # dotnet-version: 6.x - name: Setup Node version uses: actions/setup-node@v3 with: node-version: 16 - - name: Build - shell: pwsh - env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} - run: ./Build.ps1 -Build -Pack + - name: Setup .NET SDK standard (7) + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ inputs.dotnet_sdk_version }} + + - name: Clean + run: dotnet clean && dotnet nuget locals all --clear + + - name: Execute dotnet restore + run: dotnet restore + - name: Execute dotnet build + if: ${{ !(startsWith(github.ref, 'refs/tags/v')) }} + run: | + ASSEMBLY_VERSION="$(cat VERSION)" + ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0 + echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}" + FILE_VERSION="$(cat VERSION)"."${{github.run_number}}" + echo "FILE_VERSION = ${FILE_VERSION}" + INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}" + echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}" + dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION + + + - name: Execute dotnet build (Release) + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: | + ASSEMBLY_VERSION="${{github.ref_name}}" + ASSEMBLY_VERSION="${ASSEMBLY_VERSION#v}" + ASSEMBLY_VERSION="${ASSEMBLY_VERSION%%.*}".0.0.0 + echo "ASSEMBLY_VERSION = ${ASSEMBLY_VERSION}" + FILE_VERSION="$(cat VERSION)"."${{github.run_number}}" + echo "FILE_VERSION = ${FILE_VERSION}" + INFORMATIONAL_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}" + echo "INFORMATIONAL_VERSION = ${INFORMATIONAL_VERSION}" + dotnet build --configuration Release --no-restore -p:AssemblyVersion=$ASSEMBLY_VERSION -p:FileVersion=$FILE_VERSION -p:InformationalVersion=$INFORMATIONAL_VERSION + + + - name: Execute dotnet pack with release version + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: | + RELEASE_VERSION="${{github.ref_name}}" + RELEASE_VERSION="${RELEASE_VERSION#v}" + echo "RELEASE_VERSION = ${RELEASE_VERSION}" + dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$RELEASE_VERSION + + + - name: Execute dotnet pack with production version (dev or future) + if: ${{ github.ref_name == 'dev' || github.ref_name == 'future'}} + run: | + PRODUCTION_VERSION="$(cat VERSION)"-"${{github.ref_name}}"."${{github.run_number}}" + echo "PRODUCTION_VERSION = ${PRODUCTION_VERSION}" + dotnet pack --configuration Release --no-build --no-restore --output artifacts/packages -p:PackageVersion=$PRODUCTION_VERSION + - name: Upload package artifacts uses: actions/upload-artifact@v2 with: - name: packages - path: artifacts/Packages/ - retention-days: 1 \ No newline at end of file + name: ${{inputs.REPOSITORY_NAME}}-packages + path: artifacts/packages/ + retention-days: 1 diff --git a/.github/workflows/documentation-tool.yml b/.github/workflows/documentation-tool.yml index 7149621..7719e80 100644 --- a/.github/workflows/documentation-tool.yml +++ b/.github/workflows/documentation-tool.yml @@ -3,43 +3,28 @@ name: Documentation on: workflow_call: inputs: - dotnet_sdk_version: - required: true - type: string REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean jobs: Documentation: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Generate docFx - shell: pwsh - env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} - run: ./Build.ps1 -GenerateDocs + - uses: nuget/setup-nuget@v1 + with: + nuget-version: latest + + - name: Build Documentation + uses: nunit/docfx-action@v2.4.0 + with: + args: docs/docfx.json - name: Upload documentation results uses: actions/upload-artifact@v2 with: - name: documentation - path: artifacts/Documentation/ + name: ${{inputs.REPOSITORY_NAME}}-documentation + path: docs/_site retention-days: 2 \ No newline at end of file diff --git a/.github/workflows/integrationtest-tool.yml b/.github/workflows/integrationtest-tool.yml index a4fc85c..66edfd2 100644 --- a/.github/workflows/integrationtest-tool.yml +++ b/.github/workflows/integrationtest-tool.yml @@ -9,30 +9,23 @@ on: REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean jobs: IntegrationTests: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Setup .NET SDK + - name: Setup .NET SDK standard (7) uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ inputs.dotnet_sdk_version }} + - name: Setup .NET SDK 6 for testing purposes + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.x + - name: Setup Node version uses: actions/setup-node@v3 with: @@ -41,18 +34,19 @@ jobs: - name: Clean run: dotnet clean && dotnet nuget locals all --clear - - name: Execute Integration Tests - shell: pwsh - env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} - run: ./Build.ps1 -IntegrationTests + - name: Execute dotnet restore + run: dotnet restore + - name: Execute dotnet build + run: dotnet build --no-restore + + - name: Execute dotnet test (needs coverlet.collector nuget) + run: dotnet test --no-build --filter FullyQualifiedName~Integration --collect:"XPlat Code Coverage" + - name: Upload test results uses: actions/upload-artifact@v2 with: name: ${{inputs.REPOSITORY_NAME}}-test-results - path: artifacts/Tests/ - retention-days: 1 \ No newline at end of file + path: src/Tests/**/TestResults/**/coverage.cobertura.xml + retention-days: 1 + diff --git a/.github/workflows/publish-test-coverage-tool.yml b/.github/workflows/publish-test-coverage-tool.yml index 93696c3..86cd0cb 100644 --- a/.github/workflows/publish-test-coverage-tool.yml +++ b/.github/workflows/publish-test-coverage-tool.yml @@ -3,24 +3,9 @@ name: Publish-Test-Coverage on: workflow_call: inputs: - dotnet_sdk_version: - required: true - type: string REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean secrets: AWS_ACCESS_KEY_ID: required: true diff --git a/.github/workflows/publish-tool.yml b/.github/workflows/publish-tool.yml index 0b1cd2f..4924745 100644 --- a/.github/workflows/publish-tool.yml +++ b/.github/workflows/publish-tool.yml @@ -9,28 +9,34 @@ on: REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false + MORYX_PACKAGE_TARGET_DEV: + required: true + type: string + MORYX_PACKAGE_TARGET_V3_DEV: + required: true + type: string + MORYX_PACKAGE_TARGET_FUTURE: + required: true + type: string + MORYX_PACKAGE_TARGET_V3_FUTURE: + required: true type: string - MORYX_BUILD_CONFIG: - required: false + MORYX_PACKAGE_TARGET_RELEASE: + required: true type: string - MORYX_BUILDNUMBER: - required: false + MORYX_PACKAGE_TARGET_V3_RELEASE: + required: true type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean secrets: MYGET_TOKEN: - required: false + required: true NUGET_TOKEN: - required: false + required: true jobs: Publish: if: ${{ github.event_name == 'push' }} - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -38,48 +44,39 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ inputs.dotnet_sdk_version }} + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 - name: Download package artifacts uses: actions/download-artifact@v2 with: - name: packages - path: artifacts/Packages/ + name: ${{inputs.REPOSITORY_NAME}}-packages + path: artifacts/packages/ + # Use if dev branch - name: Publish on MyGet-CI if: ${{ github.ref == 'refs/heads/dev' }} # dev branche is published to myget moryx - shell: pwsh env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}} - MORYX_PACKAGE_TARGET: 'https://www.myget.org/F/moryx/api/v2/package' - MORYX_PACKAGE_TARGET_V3: 'https://www.myget.org/F/moryx/api/v3/index.json' - run: ./Build.ps1 -Publish - - - name: Publish on MyGet-Future + MORYX_PACKAGE_TARGET: ${{ inputs.MORYX_PACKAGE_TARGET_DEV }} + MORYX_PACKAGE_TARGET_V3: ${{ inputs.MORYX_PACKAGE_TARGET_V3_DEV }} + run: dotnet nuget push "artifacts/packages/" --api-key $MORYX_NUGET_APIKEY --source $MORYX_PACKAGE_TARGET --skip-duplicate --symbol-api-key $MORYX_NUGET_APIKEY --symbol-source $MORYX_PACKAGE_TARGET_V3 + + # Use if future branch + - name: Publish on MyGet-CI if: ${{ github.ref == 'refs/heads/future' }} # Future branch is published to myget moryx-future - shell: pwsh env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}} - MORYX_PACKAGE_TARGET: 'https://www.myget.org/F/moryx-future/api/v2/package' - MORYX_PACKAGE_TARGET_V3: 'https://www.myget.org/F/moryx-future/api/v3/index.json' - run: ./Build.ps1 -Publish - + MORYX_PACKAGE_TARGET: ${{ inputs.MORYX_PACKAGE_TARGET_FUTURE }} + MORYX_PACKAGE_TARGET_V3: ${{ inputs.MORYX_PACKAGE_TARGET_V3_FUTURE }} + run: dotnet nuget push "artifacts/packages/" --api-key $MORYX_NUGET_APIKEY --source $MORYX_PACKAGE_TARGET --skip-duplicate --symbol-api-key $MORYX_NUGET_APIKEY --symbol-source $MORYX_PACKAGE_TARGET_V3 + + # Use if tag - name: Publish on NuGet if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Version Tags are published to nuget - shell: pwsh env: - MORYX_BUILDNUMBER: ${{inputs.MORYX_BUILDNUMBER}} - MORYX_OPTIMIZE_CODE: ${{inputs.MORYX_OPTIMIZE_CODE}} - MORYX_BUILD_CONFIG: ${{inputs.MORYX_BUILD_CONFIG}} - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: ${{inputs.DOTNET_SKIP_FIRST_TIME_EXPERIENCE}} MORYX_NUGET_APIKEY: ${{secrets.NUGET_TOKEN}} - MORYX_PACKAGE_TARGET: 'https://api.nuget.org/v3/index.json' - MORYX_PACKAGE_TARGET_V3: 'https://api.nuget.org/v3/index.json' - run: ./Build.ps1 -Publish + MORYX_PACKAGE_TARGET: ${{ inputs.MORYX_PACKAGE_TARGET_RELEASE }} + MORYX_PACKAGE_TARGET_V3: ${{ inputs.MORYX_PACKAGE_TARGET_V3_RELEASE }} + run: dotnet nuget push "artifacts/packages/" --api-key $MORYX_NUGET_APIKEY --source $MORYX_PACKAGE_TARGET --skip-duplicate --symbol-api-key $MORYX_NUGET_APIKEY --symbol-source $MORYX_PACKAGE_TARGET_V3 \ No newline at end of file diff --git a/.github/workflows/reportgenerator-tool.yml b/.github/workflows/reportgenerator-tool.yml index 4bf6603..e7c6ae0 100644 --- a/.github/workflows/reportgenerator-tool.yml +++ b/.github/workflows/reportgenerator-tool.yml @@ -3,28 +3,13 @@ name: ReportGenerator on: workflow_call: inputs: - dotnet_sdk_version: - required: true - type: string REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean jobs: ReportGenerator: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -37,7 +22,7 @@ jobs: - name: ReportGenerator uses: danielpalme/ReportGenerator-GitHub-Action@5.1.12 with: - reports: artifacts/test-results/**/TestResults\**\coverage.cobertura.xml; artifacts/test-results/*.Cobertura.xml + reports: artifacts/test-results/**/TestResults/**/coverage.cobertura.xml targetdir: Coverage reporttypes: Html @@ -46,4 +31,4 @@ jobs: with: name: ${{inputs.REPOSITORY_NAME}}-coverage-results path: Coverage/ - retention-days: 1 \ No newline at end of file + retention-days: 1 diff --git a/.github/workflows/unittest-tool.yml b/.github/workflows/unittest-tool.yml index 8e8d643..2b5efbc 100644 --- a/.github/workflows/unittest-tool.yml +++ b/.github/workflows/unittest-tool.yml @@ -9,22 +9,10 @@ on: REPOSITORY_NAME: required: true type: string - MORYX_OPTIMIZE_CODE: - required: false - type: string - MORYX_BUILD_CONFIG: - required: false - type: string - MORYX_BUILDNUMBER: - required: false - type: string - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: - required: false - type: boolean jobs: UnitTests: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -50,14 +38,14 @@ jobs: run: dotnet restore - name: Execute dotnet build - run: dotnet build + run: dotnet build --no-restore - name: Execute dotnet test (needs coverlet.collector nuget) - run: dotnet test --collect:"XPlat Code Coverage" + run: dotnet test --no-build --filter FullyQualifiedName!~Integration --collect:"XPlat Code Coverage" - name: Upload test results uses: actions/upload-artifact@v2 with: name: ${{inputs.REPOSITORY_NAME}}-test-results - path: src\Tests\**\TestResults\**\coverage.cobertura.xml - retention-days: 1 \ No newline at end of file + path: src/Tests/**/TestResults/**/coverage.cobertura.xml + retention-days: 1