From 9ccd962da4b040aa06c6d210be1e15f0d29351b3 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:04:46 -0700 Subject: [PATCH 01/27] CI pipeline for platyPS v2 --- .ci/ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .ci/test.yml | 66 +++++++++++++++++++++++++++++++++++++++++++ build.ps1 | 1 - 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 .ci/ci.yml create mode 100644 .ci/test.yml diff --git a/.ci/ci.yml b/.ci/ci.yml new file mode 100644 index 00000000..ad660f3f --- /dev/null +++ b/.ci/ci.yml @@ -0,0 +1,80 @@ +name: Build-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) +trigger: + # Batch merge builds together while a merge build is running + batch: true + branches: + include: + - master + - release/* +pr: + branches: + include: + - master + - release/* + +stages: +- stage: Build + displayName: Build PowerShell Package + jobs: + - job: BuildPkg + displayName: Build Package + pool: + vmImage: windows-latest + steps: + - pwsh: | + $(Build.SourcesDirectory)/build.ps1 -Clean + displayName: Build + + - pwsh: | + $files = (Get-ChildItem -Recurse '$(Build.SourcesDirectory)/out/platyPS' -File).FullName + + $files | ForEach-Object { + Write-Host "##vso[artifact.upload containerfolder=platyPS;artifactname=platyPS]$_" + } + displayName: Publish build artifact + timeoutInMinutes: 10 + + - pwsh: | + Register-PSRepository -Name local -SourceLocation '$(System.ArtifactsDirectory)' -Verbose -ErrorAction Ignore + Publish-Module -Repository local -Path '$(Build.SourcesDirectory)/out/platyPS' -Verbose + $nupkgFile = Get-ChildItem -Path '$(System.ArtifactsDirectory)/platyPS*.nupkg' + + Write-Verbose -Verbose "Uploading: $nupkgFile" + Write-Host "##vso[artifact.upload containerfolder=nupkg;artifactname=nupkg]$nupkgFile" + + displayName: Create module .nupkg and upload + +- stage: Test + displayName: Test Package + jobs: + - template: test.yml + parameters: + jobName: TestPkgWin + displayName: PowerShell Core on Windows + imageName: windows-2019 + + - template: test.yml + parameters: + jobName: TestPkgWinPS + displayName: Windows PowerShell on Windows + imageName: windows-2019 + powershellExecutable: powershell + + - template: test.yml + parameters: + jobName: TestPkgUbuntu16 + displayName: PowerShell Core on Ubuntu 16.04 + imageName: ubuntu-16.04 + + - template: test.yml + parameters: + jobName: TestPkgWinMacOS + displayName: PowerShell Core on macOS + imageName: macOS-10.14 + +- stage: Release + displayName: Release Package + # add `succeeded(),` to the and statement + condition: and( eq(variables['Build.Reason'], 'Manual'), eq(variables['Publish'], 'Yes')) + jobs: + - template: release.yml diff --git a/.ci/test.yml b/.ci/test.yml new file mode 100644 index 00000000..807371db --- /dev/null +++ b/.ci/test.yml @@ -0,0 +1,66 @@ +parameters: + jobName: TestPkgWin + imageName: windows-latest + displayName: PowerShell Core on Windows + powershellExecutable: pwsh + +jobs: +- job: ${{ parameters.jobName }} + pool: + vmImage: ${{ parameters.imageName }} + displayName: ${{ parameters.displayName }} + steps: + - ${{ parameters.powershellExecutable }}: | + Install-module Pester -Force -MaximumVersion 4.99 + displayName: Install dependencies - Pester + timeoutInMinutes: 10 + + - ${{ parameters.powershellExecutable }}: | + Get-InstalledModule -Name pester -AllVersions | Where-Object {$_.Version -ge ([version]::new(5,0,0))} | Uninstall-Module -Force + displayName: Remove >= 5.0.0 Pester + + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifacts' + inputs: + buildType: current + downloadType: specific + itemPattern: '**/*.nupkg' + downloadPath: '$(System.ArtifactsDirectory)' + artifactName: 'nupkg' + + - ${{ parameters.powershellExecutable }}: | + $sourceName = 'pspackageproject-local-repo' + Register-PSRepository -Name $sourceName -SourceLocation '$(System.ArtifactsDirectory)' -ErrorAction Ignore + Save-Module -Repository $sourceName -Name platyPS -Path '$(System.ArtifactsDirectory)/saved' -Verbose + displayName: Extract product artifact + timeoutInMinutes: 10 + + - ${{ parameters.powershellExecutable }}: | + '$(Build.SourcesDirectory)/build.ps1' -OutputDir '$(System.ArtifactsDirectory)/saved' -Test + + $pesterResult = '$(Build.SourcesDirectory)/pester.tests.xml' + + if (-not (Test-Path $pesterResult)) + { + throw 'Pester test results not found' + } + + Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Pester;publishRunAttachments=true;resultFiles=$pesterResult;]" + + $xunitResult = '$(Build.SourcesDirectory)/xunit.tests.xml' + + if (-not (Test-Path $pesterRexunitResultsult)) + { + throw 'xUnit test results not found' + } + + Write-Host "##vso[results.publish type=xUnit;mergeResults=true;runTitle=Pester;publishRunAttachments=true;resultFiles=$xunitResult;]" + + displayName: Execute functional tests + errorActionPreference: continue + + - ${{ parameters.powershellExecutable }}: | + Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore + displayName: Unregister temporary PSRepository + condition: always() + timeoutInMinutes: 10 \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index b3011180..92f3ad8d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -7,7 +7,6 @@ param( [ValidateSet("Debug", "Release")] [string] $Configuration = "Debug", - [Parameter(ParameterSetName = "Build")] [string] $OutputDir = "$PSScriptRoot/out", [Parameter(ParameterSetName = "Test", Mandatory)] From 52f4e14d3dda54d341cdfd4673c45ef4f446ae5b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:09:36 -0700 Subject: [PATCH 02/27] Comment out release stage --- .ci/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.ci/ci.yml b/.ci/ci.yml index ad660f3f..32cef3eb 100644 --- a/.ci/ci.yml +++ b/.ci/ci.yml @@ -72,9 +72,9 @@ stages: displayName: PowerShell Core on macOS imageName: macOS-10.14 -- stage: Release - displayName: Release Package - # add `succeeded(),` to the and statement - condition: and( eq(variables['Build.Reason'], 'Manual'), eq(variables['Publish'], 'Yes')) - jobs: - - template: release.yml +#- stage: Release +# displayName: Release Package +# # add `succeeded(),` to the and statement +# condition: and( eq(variables['Build.Reason'], 'Manual'), eq(variables['Publish'], 'Yes')) +# jobs: +# - template: release.yml From 32903d0ac4f3d987e0f78d5b4f2bc0a1f7cfb2d9 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:16:08 -0700 Subject: [PATCH 03/27] Add verbose --- .ci/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test.yml b/.ci/test.yml index 807371db..139584cc 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -30,7 +30,8 @@ jobs: - ${{ parameters.powershellExecutable }}: | $sourceName = 'pspackageproject-local-repo' - Register-PSRepository -Name $sourceName -SourceLocation '$(System.ArtifactsDirectory)' -ErrorAction Ignore + Register-PSRepository -Name $sourceName -SourceLocation '$(System.ArtifactsDirectory)/nupkg' -ErrorAction Ignore -Verbose + $null = New-Item -Path '$(System.ArtifactsDirectory)/saved' -ItemType Directory Save-Module -Repository $sourceName -Name platyPS -Path '$(System.ArtifactsDirectory)/saved' -Verbose displayName: Extract product artifact timeoutInMinutes: 10 From 8bd8fef7f4b1210b9e819612119186490e54be5d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:22:09 -0700 Subject: [PATCH 04/27] Fix script invocation --- .ci/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.yml b/.ci/test.yml index 139584cc..cac27e01 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -37,7 +37,7 @@ jobs: timeoutInMinutes: 10 - ${{ parameters.powershellExecutable }}: | - '$(Build.SourcesDirectory)/build.ps1' -OutputDir '$(System.ArtifactsDirectory)/saved' -Test + $(Build.SourcesDirectory)/build.ps1 -OutputDir '$(System.ArtifactsDirectory)/saved' -Test $pesterResult = '$(Build.SourcesDirectory)/pester.tests.xml' From 925fbd9473f50d0c71df3b5ef3db9af54e71ef93 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:28:20 -0700 Subject: [PATCH 05/27] Add nuget config for tests --- test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config diff --git a/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config b/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config new file mode 100644 index 00000000..65485861 --- /dev/null +++ b/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config @@ -0,0 +1,10 @@ + + + + + + + + + + From bc92121b6496f91306ca4d127c06450bac14dc31 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 6 May 2021 14:54:00 -0700 Subject: [PATCH 06/27] Add protocol version to nuget.config --- test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config b/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config index 65485861..9ebb819a 100644 --- a/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config +++ b/test/Microsoft.PowerShell.PlatyPS.Tests/nuget.config @@ -2,7 +2,7 @@ - + From bd9e65e2223a0aa64c7debcfe8ccc6538e8c48d7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 10 May 2021 13:05:40 -0700 Subject: [PATCH 07/27] Add dotnet restore --- .ci/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.ci/test.yml b/.ci/test.yml index cac27e01..af26f7b8 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -28,6 +28,13 @@ jobs: downloadPath: '$(System.ArtifactsDirectory)' artifactName: 'nupkg' + - task: DotNetCoreCLI@2 + displayName: dotnet restore + inputs: + command: restore + projects: '$(Build.SourcesDirectory)/**/*.csproj' + includeNuGetOrg: true + - ${{ parameters.powershellExecutable }}: | $sourceName = 'pspackageproject-local-repo' Register-PSRepository -Name $sourceName -SourceLocation '$(System.ArtifactsDirectory)/nupkg' -ErrorAction Ignore -Verbose From 58b9b3ed0fd55ec5b0e9cb00ef0bfdecc77510b1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 10 May 2021 17:48:28 -0700 Subject: [PATCH 08/27] Test fixes --- .ci/test.yml | 2 +- build.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index af26f7b8..0a0c4d5d 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -57,7 +57,7 @@ jobs: $xunitResult = '$(Build.SourcesDirectory)/xunit.tests.xml' - if (-not (Test-Path $pesterRexunitResultsult)) + if (-not (Test-Path $xunitResult)) { throw 'xUnit test results not found' } diff --git a/build.ps1 b/build.ps1 index 92f3ad8d..c7650ae4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -90,7 +90,7 @@ elseif ($PSCmdlet.ParameterSetName -eq 'Test') { } $pesterTestRoot = "$PSScriptRoot/test/Pester" - Write-Verbose "Executing Pester tests under $pesterTestRoot" + Write-Verbose "Executing Pester tests under $pesterTestRoot" -Verbose $results = Invoke-Pester -Script $pesterTestRoot -PassThru -Outputformat nunitxml -outputfile $PesterLogPath From df94cade1dcefedaaa7abfff0d83289ce1539dd4 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 12:22:31 -0700 Subject: [PATCH 09/27] Add test run names --- .ci/test.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index 0a0c4d5d..b9c8a5a4 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -11,13 +11,14 @@ jobs: displayName: ${{ parameters.displayName }} steps: - ${{ parameters.powershellExecutable }}: | - Install-module Pester -Force -MaximumVersion 4.99 - displayName: Install dependencies - Pester + Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 | Uninstall-Module -Force -Verbose + displayName: Remove >= 5.0.0 Pester timeoutInMinutes: 10 - ${{ parameters.powershellExecutable }}: | - Get-InstalledModule -Name pester -AllVersions | Where-Object {$_.Version -ge ([version]::new(5,0,0))} | Uninstall-Module -Force - displayName: Remove >= 5.0.0 Pester + Install-module Pester -Force -MaximumVersion 4.99 + displayName: Install dependencies - Pester + timeoutInMinutes: 10 - task: DownloadBuildArtifacts@0 displayName: 'Download artifacts' @@ -61,14 +62,25 @@ jobs: { throw 'xUnit test results not found' } - - Write-Host "##vso[results.publish type=xUnit;mergeResults=true;runTitle=Pester;publishRunAttachments=true;resultFiles=$xunitResult;]" - displayName: Execute functional tests errorActionPreference: continue + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '**/pester.tests.xml' + testRunTitle: '${{ parameters.jobName }}-Pester' + displayname: Uploade Pester test results + + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'xUnit' + testResultsFiles: '**/xunit.tests.xml' + testRunTitle: '${{ parameters.jobName }}-xUnit' + displayname: Uploade xUnit test results + - ${{ parameters.powershellExecutable }}: | Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore displayName: Unregister temporary PSRepository condition: always() - timeoutInMinutes: 10 \ No newline at end of file + timeoutInMinutes: 10 From 87c09f0e2b31b245e285daa84e6031023a7bc5e4 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 12:30:57 -0700 Subject: [PATCH 10/27] Fix yaml --- .ci/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index b9c8a5a4..187f9df8 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -70,14 +70,12 @@ jobs: testResultsFormat: 'NUnit' testResultsFiles: '**/pester.tests.xml' testRunTitle: '${{ parameters.jobName }}-Pester' - displayname: Uploade Pester test results - task: PublishTestResults@2 inputs: testResultsFormat: 'xUnit' testResultsFiles: '**/xunit.tests.xml' testRunTitle: '${{ parameters.jobName }}-xUnit' - displayname: Uploade xUnit test results - ${{ parameters.powershellExecutable }}: | Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore From c07715f6d552d55b13005a63db07c6caa3300520 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 12:39:56 -0700 Subject: [PATCH 11/27] Add EA silentlycontinue --- .ci/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.yml b/.ci/test.yml index 187f9df8..4851f6de 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -11,7 +11,7 @@ jobs: displayName: ${{ parameters.displayName }} steps: - ${{ parameters.powershellExecutable }}: | - Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 | Uninstall-Module -Force -Verbose + Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose displayName: Remove >= 5.0.0 Pester timeoutInMinutes: 10 From 68b6992b7b5b985b96d632c200bfd392e1aef52b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 13:04:02 -0700 Subject: [PATCH 12/27] Fix tests --- .ci/test.yml | 2 ++ test/Pester/PlatyPs.Tests.ps1 | 36 +++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index 4851f6de..652f8f55 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -11,6 +11,8 @@ jobs: displayName: ${{ parameters.displayName }} steps: - ${{ parameters.powershellExecutable }}: | + Get-Module + Remove-Module Pester -Verbose -ErrorAction SilentlyContinue Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose displayName: Remove >= 5.0.0 Pester timeoutInMinutes: 10 diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index 25defe03..95718f95 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -20,8 +20,8 @@ Describe 'New-MarkdownHelp' { } It 'throw when cannot find maml file' { - $null = New-Item -ItemType File -Path "$TestDrive\somefile.txt" - { New-MarkdownHelp -Command 'New-MarkdownHelp' -OutputFolder "$TestDrive\somefile.txt" } | + $null = New-Item -ItemType File -Path "$TestDrive/somefile.txt" + { New-MarkdownHelp -Command 'New-MarkdownHelp' -OutputFolder "$TestDrive/somefile.txt" } | Should -Throw -ErrorId 'PathIsNotFolder,Microsoft.PowerShell.PlatyPS.NewMarkdownHelpCommand' } } @@ -100,7 +100,7 @@ Describe 'New-MarkdownHelp' { } | Import-Module -Force - $files = New-MarkdownHelp -Module PlatyPSTestModule -OutputFolder "$TestDrive\PlatyPSTestModule" -Force + $files = New-MarkdownHelp -Module PlatyPSTestModule -OutputFolder "$TestDrive/PlatyPSTestModule" -Force } AfterAll { @@ -145,8 +145,8 @@ Describe 'New-MarkdownHelp' { #> Write-Host 'Hello World!' "@ - Set-Content -Value $SeedData -Path "$TestDrive\Invoke-HelloWorld.ps1" -NoNewline - $files = New-MarkdownHelp -Command "$TestDrive\Invoke-HelloWorld.ps1" -OutputFolder "$TestDrive\output" -Force + Set-Content -Value $SeedData -Path "$TestDrive/Invoke-HelloWorld.ps1" -NoNewline + $files = New-MarkdownHelp -Command "$TestDrive/Invoke-HelloWorld.ps1" -OutputFolder "$TestDrive/output" -Force $files | Should -HaveCount 1 } @@ -166,10 +166,10 @@ Write-Host 'Hello World!' #> Write-Host 'Hello World!' "@ - Set-Content -Value $SeedData -Path "$TestDrive\Invoke-HelloWorld.ps1" -NoNewline + Set-Content -Value $SeedData -Path "$TestDrive/Invoke-HelloWorld.ps1" -NoNewline $Location = Get-Location Set-Location $TestDrive - $files = New-MarkdownHelp -Command "$TestDrive\Invoke-HelloWorld.ps1" -OutputFolder "$TestDrive\output" -Force + $files = New-MarkdownHelp -Command "$TestDrive/Invoke-HelloWorld.ps1" -OutputFolder "$TestDrive/output" -Force Set-Location $Location $files | Should -HaveCount 1 } @@ -216,7 +216,7 @@ Write-Host 'Hello World!' ### -WhatIf '@ - $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive\alpha" -Force -AlphabeticParamsOrder + $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive/alpha" -Force -AlphabeticParamsOrder $files | Should -HaveCount 1 normalizeEnds (Get-Content $files | Where-Object {$_.StartsWith('### -')} | Out-String) | Should -Be $expectedOrder } @@ -258,7 +258,7 @@ Write-Host 'Hello World!' ) } - $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder "$TestDrive\testAll1" -Force + $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder "$TestDrive/testAll1" -Force $content = Get-Content $file It 'generates markdown with correct parameter set names' { @@ -299,7 +299,7 @@ Write-Host 'Hello World!' ) } - $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder "$TestDrive\testAll2" -Force + $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder "$TestDrive/testAll2" -Force $content = Get-Content $file It 'generates markdown with correct synopsis placeholder' { @@ -369,8 +369,8 @@ Write-Host 'Hello World!' Context 'Module Landing Page'{ BeforeAll { - $OutputFolder = "$TestDrive\LandingPageMD\" - $OutputFolderReadme = "$TestDrive\LandingPageMD-ReadMe\Readme.md" + $OutputFolder = "$TestDrive/LandingPageMD/" + $OutputFolderReadme = "$TestDrive/LandingPageMD-ReadMe/Readme.md" $null = New-Item -ItemType Directory $OutputFolder } @@ -381,7 +381,7 @@ Write-Host 'Hello World!' } It "generates a landing page from MAML" -Pending { - New-MarkdownHelp -MamlFile (Get-ChildItem "$outFolder\platyPS\en-US\platy*xml") ` + New-MarkdownHelp -MamlFile (Get-ChildItem "$outFolder/platyPS/en-US/platy*xml") ` -OutputFolder $OutputFolder ` -WithModulePage ` -ModuleName "PlatyPS" ` @@ -425,7 +425,7 @@ Get-Alpha [-WhatIf] [[-CCC] ] [[-ddd] ] [] '@ - $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive\alpha" -Force -AlphabeticParamsOrder -UseFullTypeName + $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive/alpha" -Force -AlphabeticParamsOrder -UseFullTypeName $files | Should -HaveCount 1 normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should -Be $expectedParameters normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Get-Alpha')} | Out-String) | Should -Be $expectedSyntax @@ -443,7 +443,7 @@ Get-Alpha [-WhatIf] [[-CCC] ] [[-ddd] ] [] '@ - $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive\alpha" -Force -AlphabeticParamsOrder + $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder "$TestDrive/alpha" -Force -AlphabeticParamsOrder $files | Should -HaveCount 1 normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should Be $expectedParameters normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Get-Alpha')} | Out-String) | Should Be $expectedSyntax @@ -463,7 +463,7 @@ Get-Alpha [-WhatIf] [[-CCC] ] [[-ddd] ] [] ) } - $file = New-MarkdownHelp -Command 'Test-WildCardsAttribute' -OutputFolder "$TestDrive\NewMarkDownHelp" + $file = New-MarkdownHelp -Command 'Test-WildCardsAttribute' -OutputFolder "$TestDrive/NewMarkDownHelp" } It 'sets accepts wildcards property on parameters as expected' { @@ -475,7 +475,7 @@ Get-Alpha [-WhatIf] [[-CCC] ] [[-ddd] ] [] Describe 'Get-MarkdownMetadata' { Context 'Simple markdown file' { BeforeAll { - Set-Content -Path "$TestDrive\foo.md" -Value @' + Set-Content -Path "$TestDrive/foo.md" -Value @' --- external help file: Microsoft.PowerShell.Archive-help.xml keywords: powershell,cmdlet @@ -501,7 +501,7 @@ title: Compress-Archive } It 'can parse out yaml snippet' { - $d = Get-MarkdownMetadata "$TestDrive\foo.md" + $d = Get-MarkdownMetadata "$TestDrive/foo.md" $d.Keys | Should -HaveCount 8 $d.Keys | Should -BeIn "external help file", "keywords", "Locale", "Module Name", "ms.date", "online version", "schema", "title" $d["Locale"] | Should -Be 'en-US' From 880f858c868b24aa5bbc1696dbfadac44cdcc9b2 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 14:07:47 -0700 Subject: [PATCH 13/27] Add logging to remove platyPS v5 --- .ci/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.yml b/.ci/test.yml index 652f8f55..b80934bc 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -11,7 +11,7 @@ jobs: displayName: ${{ parameters.displayName }} steps: - ${{ parameters.powershellExecutable }}: | - Get-Module + Get-Module | Out-String | Write-Verbose -Verbose Remove-Module Pester -Verbose -ErrorAction SilentlyContinue Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose displayName: Remove >= 5.0.0 Pester From 6d2303f27d53942bea7cfbccac289b4abebf3658 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 14:07:59 -0700 Subject: [PATCH 14/27] Fix test --- test/Pester/PlatyPs.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index 95718f95..a67479a7 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -376,7 +376,7 @@ Write-Host 'Hello World!' It "generates a landing page from Module"{ New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force - $LandingPage = Get-ChildItem (Join-Path $OutputFolder PlatyPS.md) + $LandingPage = Get-ChildItem "$OutputFolder/PlatyPS.md" $LandingPage | Should -Exist } From e1a380ddf1645d0001954c760759dbdff3e49aee Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 14:19:36 -0700 Subject: [PATCH 15/27] Use file path instead of file info --- test/Pester/PlatyPs.Tests.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index a67479a7..405b55bd 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -376,8 +376,7 @@ Write-Host 'Hello World!' It "generates a landing page from Module"{ New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force - $LandingPage = Get-ChildItem "$OutputFolder/PlatyPS.md" - $LandingPage | Should -Exist + "$OutputFolder/PlatyPS.md" | Should -Exist } It "generates a landing page from MAML" -Pending { From 17928c7ea66f17f87b4deafe392887e7945f1ca0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 14:28:40 -0700 Subject: [PATCH 16/27] Add logging to test --- test/Pester/PlatyPs.Tests.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index 405b55bd..c3159b1f 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -376,7 +376,10 @@ Write-Host 'Hello World!' It "generates a landing page from Module"{ New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force - "$OutputFolder/PlatyPS.md" | Should -Exist + + Get-ChildItem $OutputFolder -Recurse | Out-String | Write-Verbose -Verbose + + "$OutputFolder/platyPS.md" | Should -Exist } It "generates a landing page from MAML" -Pending { From 9b4c759d4f99a6108f003a34c27b1b820e31f57a Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 14:42:09 -0700 Subject: [PATCH 17/27] Fix test --- test/Pester/PlatyPs.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index c3159b1f..b11a7e81 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -369,7 +369,7 @@ Write-Host 'Hello World!' Context 'Module Landing Page'{ BeforeAll { - $OutputFolder = "$TestDrive/LandingPageMD/" + $OutputFolder = "$TestDrive/LandingPageMD" $OutputFolderReadme = "$TestDrive/LandingPageMD-ReadMe/Readme.md" $null = New-Item -ItemType Directory $OutputFolder } From f0e0943e613750e0d45c796adbcaad559a701477 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 15:34:06 -0700 Subject: [PATCH 18/27] Mark test as pending on macOS --- test/Pester/PlatyPs.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index b11a7e81..3b05e9ce 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -374,7 +374,7 @@ Write-Host 'Hello World!' $null = New-Item -ItemType Directory $OutputFolder } - It "generates a landing page from Module"{ + It "generates a landing page from Module" -Pending:$IsMacOS { New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force Get-ChildItem $OutputFolder -Recurse | Out-String | Write-Verbose -Verbose From 6941b860c3f232cb2d4c5e607e8eed4408c45287 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 17:06:29 -0700 Subject: [PATCH 19/27] Fix tests --- .ci/test.yml | 2 ++ build.ps1 | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.ci/test.yml b/.ci/test.yml index b80934bc..49f7281c 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -12,6 +12,8 @@ jobs: steps: - ${{ parameters.powershellExecutable }}: | Get-Module | Out-String | Write-Verbose -Verbose + Get-Module -List Pester | Out-String | Write-Verbose -Verbose + Get-Process pwsh -ErrorAction SilentlyContinue | Out-String | Write-Verbose -Verbose Remove-Module Pester -Verbose -ErrorAction SilentlyContinue Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose displayName: Remove >= 5.0.0 Pester diff --git a/build.ps1 b/build.ps1 index c7650ae4..0f66941f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -79,7 +79,16 @@ elseif ($PSCmdlet.ParameterSetName -eq 'Test') { try { Push-Location $xunitTestRoot - dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" + $testArgs = @( + "test" + "--test-adapter-path:." + "--logger:xunit;LogFilePath=$XUnitLogPath" + "--no-build" + ) + + #dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" + + dotnet $testArgs if ($LASTEXITCODE -eq 0) { $xunitTestFailed = $false From e2c0326230935b8307576f076a7542985cf523e0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 17:53:44 -0700 Subject: [PATCH 20/27] Make xunit test windows only --- .ci/test.yml | 16 +++++----- build.ps1 | 30 +++++++------------ .../Microsoft.PowerShell.PlatyPS.Tests.csproj | 2 +- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index 49f7281c..084ae007 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -10,14 +10,14 @@ jobs: vmImage: ${{ parameters.imageName }} displayName: ${{ parameters.displayName }} steps: - - ${{ parameters.powershellExecutable }}: | - Get-Module | Out-String | Write-Verbose -Verbose - Get-Module -List Pester | Out-String | Write-Verbose -Verbose - Get-Process pwsh -ErrorAction SilentlyContinue | Out-String | Write-Verbose -Verbose - Remove-Module Pester -Verbose -ErrorAction SilentlyContinue - Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose - displayName: Remove >= 5.0.0 Pester - timeoutInMinutes: 10 + #- ${{ parameters.powershellExecutable }}: | + # Get-Module | Out-String | Write-Verbose -Verbose + # Get-Module -List Pester | Out-String | Write-Verbose -Verbose + # Get-Process pwsh -ErrorAction SilentlyContinue | Out-String | Write-Verbose -Verbose + # Remove-Module Pester -Verbose -ErrorAction SilentlyContinue + # Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose + # displayName: Remove >= 5.0.0 Pester + # timeoutInMinutes: 10 - ${{ parameters.powershellExecutable }}: | Install-module Pester -Force -MaximumVersion 4.99 diff --git a/build.ps1 b/build.ps1 index 0f66941f..4a13e88c 100644 --- a/build.ps1 +++ b/build.ps1 @@ -47,8 +47,7 @@ if ($PSCmdlet.ParameterSetName -eq 'Build') { $expectedBuildPath = "./bin/$Configuration/net461/" $expectedDllPath = "$expectedBuildPath/Microsoft.PowerShell.PlatyPS.dll" - if (-not (Test-Path $expectedDllPath)) - { + if (-not (Test-Path $expectedDllPath)) { throw "Build did not succeed." } @@ -72,26 +71,18 @@ if ($PSCmdlet.ParameterSetName -eq 'Build') { elseif ($PSCmdlet.ParameterSetName -eq 'Test') { Import-Module -Name "$OutputDir/platyPS" -Force - $xunitTestRoot = "$PSScriptRoot/test/Microsoft.PowerShell.PlatyPS.Tests" - Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose - - $xunitTestFailed = $true - try { + $xunitTestRoot = "$PSScriptRoot/test/Microsoft.PowerShell.PlatyPS.Tests" + Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose + $xunitTestFailed = $true Push-Location $xunitTestRoot - $testArgs = @( - "test" - "--test-adapter-path:." - "--logger:xunit;LogFilePath=$XUnitLogPath" - "--no-build" - ) - #dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" - - dotnet $testArgs + if ($IsWindows) { + dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" + } if ($LASTEXITCODE -eq 0) { - $xunitTestFailed = $false + throw "XUnit test failed" } } finally { @@ -103,8 +94,7 @@ elseif ($PSCmdlet.ParameterSetName -eq 'Test') { $results = Invoke-Pester -Script $pesterTestRoot -PassThru -Outputformat nunitxml -outputfile $PesterLogPath - if ($results.FailedCount -ne 0 -or $xunitTestFailed) - { - throw "Tests failed." + if ($results.FailedCount -ne 0) { + throw "Pester Tests failed." } } diff --git a/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj b/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj index 2dc48800..ee79e07b 100644 --- a/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj +++ b/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj @@ -1,7 +1,7 @@  - net461 + net461;net5.0 win7-x64 From 85f1fa8e0fbc502af6ea11170471bdd627c3628f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 17:54:10 -0700 Subject: [PATCH 21/27] Remove unused variable --- build.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 4a13e88c..af4c3240 100644 --- a/build.ps1 +++ b/build.ps1 @@ -74,7 +74,6 @@ elseif ($PSCmdlet.ParameterSetName -eq 'Test') { try { $xunitTestRoot = "$PSScriptRoot/test/Microsoft.PowerShell.PlatyPS.Tests" Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose - $xunitTestFailed = $true Push-Location $xunitTestRoot if ($IsWindows) { From 7a273cbda80e2a870c4eb256fff6edae52277e0b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 17:57:56 -0700 Subject: [PATCH 22/27] Add xunit condition in yml --- .ci/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index 084ae007..26d39188 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -60,11 +60,14 @@ jobs: Write-Host "##vso[results.publish type=NUnit;mergeResults=true;runTitle=Pester;publishRunAttachments=true;resultFiles=$pesterResult;]" - $xunitResult = '$(Build.SourcesDirectory)/xunit.tests.xml' - - if (-not (Test-Path $xunitResult)) + if ($IsWindows) { - throw 'xUnit test results not found' + $xunitResult = '$(Build.SourcesDirectory)/xunit.tests.xml' + + if (-not (Test-Path $xunitResult)) + { + throw 'xUnit test results not found' + } } displayName: Execute functional tests errorActionPreference: continue From 1d91a037caaadb8896d2803f9c8e432b730ade66 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 18:06:46 -0700 Subject: [PATCH 23/27] Test fixes and module page fix --- build.ps1 | 22 ++++++++++------------ src/MarkdownWriter/ModulePageWriter.cs | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/build.ps1 b/build.ps1 index af4c3240..83f122d6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -71,22 +71,20 @@ if ($PSCmdlet.ParameterSetName -eq 'Build') { elseif ($PSCmdlet.ParameterSetName -eq 'Test') { Import-Module -Name "$OutputDir/platyPS" -Force - try { - $xunitTestRoot = "$PSScriptRoot/test/Microsoft.PowerShell.PlatyPS.Tests" - Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose - Push-Location $xunitTestRoot - - if ($IsWindows) { + if ($IsWindows) { + try { + $xunitTestRoot = "$PSScriptRoot/test/Microsoft.PowerShell.PlatyPS.Tests" + Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose + Push-Location $xunitTestRoot dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" + if ($LASTEXITCODE -eq 0) { + throw "XUnit test failed" + } } - - if ($LASTEXITCODE -eq 0) { - throw "XUnit test failed" + finally { + Pop-Location } } - finally { - Pop-Location - } $pesterTestRoot = "$PSScriptRoot/test/Pester" Write-Verbose "Executing Pester tests under $pesterTestRoot" -Verbose diff --git a/src/MarkdownWriter/ModulePageWriter.cs b/src/MarkdownWriter/ModulePageWriter.cs index 211c39c1..1a637564 100644 --- a/src/MarkdownWriter/ModulePageWriter.cs +++ b/src/MarkdownWriter/ModulePageWriter.cs @@ -47,7 +47,7 @@ internal FileInfo Write(Collection helpItems) if (!string.Equals(modulePage.Extension, ".md", StringComparison.OrdinalIgnoreCase)) { - _modulePagePath = $"{_modulePagePath}\\{moduleName}.md"; + _modulePagePath = $"{_modulePagePath}{Constants.DirectorySeparator}{moduleName}.md"; } else { From 850c093e4e25178545ebac086dc771015ff7ebc6 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 18:14:46 -0700 Subject: [PATCH 24/27] Remove net5.0 target framework --- .../Microsoft.PowerShell.PlatyPS.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj b/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj index ee79e07b..2dc48800 100644 --- a/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj +++ b/test/Microsoft.PowerShell.PlatyPS.Tests/Microsoft.PowerShell.PlatyPS.Tests.csproj @@ -1,7 +1,7 @@  - net461;net5.0 + net461 win7-x64 From 519050181fc4a30d9467f1aaaf7cbc66ccc6b3e8 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 18:22:06 -0700 Subject: [PATCH 25/27] Fix error condition --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 83f122d6..7c1b28d2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -77,7 +77,7 @@ elseif ($PSCmdlet.ParameterSetName -eq 'Test') { Write-Verbose "Executing XUnit tests under $xunitTestRoot" -Verbose Push-Location $xunitTestRoot dotnet test --test-adapter-path:. "--logger:xunit;LogFilePath=$XUnitLogPath" - if ($LASTEXITCODE -eq 0) { + if ($LASTEXITCODE -ne 0) { throw "XUnit test failed" } } From de3d22c2c1b21427d86f8d5c25294e25c024d8db Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 May 2021 18:29:17 -0700 Subject: [PATCH 26/27] Remove extra logging and add back uninstall pester --- .ci/test.yml | 12 ++++-------- test/Pester/PlatyPs.Tests.ps1 | 3 --- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.ci/test.yml b/.ci/test.yml index 26d39188..380aa7c9 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -10,14 +10,10 @@ jobs: vmImage: ${{ parameters.imageName }} displayName: ${{ parameters.displayName }} steps: - #- ${{ parameters.powershellExecutable }}: | - # Get-Module | Out-String | Write-Verbose -Verbose - # Get-Module -List Pester | Out-String | Write-Verbose -Verbose - # Get-Process pwsh -ErrorAction SilentlyContinue | Out-String | Write-Verbose -Verbose - # Remove-Module Pester -Verbose -ErrorAction SilentlyContinue - # Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose - # displayName: Remove >= 5.0.0 Pester - # timeoutInMinutes: 10 + - ${{ parameters.powershellExecutable }}: | + Get-InstalledModule -Name pester -AllowPrerelease -MinimumVersion 5.0.0 -ErrorAction SilentlyContinue | Uninstall-Module -Force -Verbose -ErrorAction SilentlyContinue + displayName: Remove >= 5.0.0 Pester + timeoutInMinutes: 10 - ${{ parameters.powershellExecutable }}: | Install-module Pester -Force -MaximumVersion 4.99 diff --git a/test/Pester/PlatyPs.Tests.ps1 b/test/Pester/PlatyPs.Tests.ps1 index 3b05e9ce..a651323d 100644 --- a/test/Pester/PlatyPs.Tests.ps1 +++ b/test/Pester/PlatyPs.Tests.ps1 @@ -376,9 +376,6 @@ Write-Host 'Hello World!' It "generates a landing page from Module" -Pending:$IsMacOS { New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force - - Get-ChildItem $OutputFolder -Recurse | Out-String | Write-Verbose -Verbose - "$OutputFolder/platyPS.md" | Should -Exist } From 2ec8c0fa37f5dee5ff97ef769a3b23d733614b38 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 13 May 2021 08:07:56 -0700 Subject: [PATCH 27/27] Add compliance --- .ci/ci.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.ci/ci.yml b/.ci/ci.yml index 32cef3eb..f23ccc4e 100644 --- a/.ci/ci.yml +++ b/.ci/ci.yml @@ -12,6 +12,13 @@ pr: - master - release/* +resources: + repositories: + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/Compliance + stages: - stage: Build displayName: Build PowerShell Package @@ -72,9 +79,14 @@ stages: displayName: PowerShell Core on macOS imageName: macOS-10.14 -#- stage: Release -# displayName: Release Package -# # add `succeeded(),` to the and statement -# condition: and( eq(variables['Build.Reason'], 'Manual'), eq(variables['Publish'], 'Yes')) -# jobs: -# - template: release.yml +- stage: compliance + displayName: Compliance + dependsOn: Build + jobs: + - job: Compliance_Job + pool: + name: windows-latest + steps: + - checkout: self + - checkout: ComplianceRepo + - template: ci-compliance.yml@ComplianceRepo