-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Run tests against built module (#363)
- Loading branch information
Showing
6 changed files
with
216 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory)] | ||
[string] | ||
$Path, | ||
|
||
[Parameter(Mandatory)] | ||
[string] | ||
$Name | ||
) | ||
|
||
$RepositoryFolder = if (-not (Test-Path $Path)) { | ||
New-Item -ItemType Directory -Path $Path -Force | ||
} | ||
else { | ||
Get-Item -Path $Path | ||
} | ||
|
||
$Params = @{ | ||
Name = $Name | ||
SourceLocation = $RepositoryFolder.FullName | ||
ScriptSourceLocation = $RepositoryFolder.FullName | ||
InstallationPolicy = 'Trusted' | ||
} | ||
Register-PSRepository @Params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
parameters: | ||
- name: repositoryPath | ||
type: string | ||
default: '$(System.DefaultWorkingDirectory)' | ||
- name: repositoryName | ||
type: string | ||
default: 'FileSystem' | ||
- name: artifactName | ||
type: string | ||
default: 'PSKoans.nupkg' | ||
|
||
steps: | ||
- template: ./register-local-repo.yml | ||
parameters: | ||
repositoryPath: ${{ parameters.repositoryPath }} | ||
repositoryName: ${{ parameters.repositoryName }} | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
displayName: 'Download Built Module Artifact' | ||
inputs: | ||
artifact: ${{ parameters.artifactName }} | ||
path: ${{ parameters.repositoryPath }} | ||
|
||
- task: PowerShell@2 | ||
displayName: 'Install PSKoans from Nupkg' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
Register-PackageSource -Name PSGallery -ProviderName NuGet -Location https://www.powershellgallery.com/api/v2 -Force | ||
Save-Package -Name Pester -ProviderName NuGet -Path ${{ parameters.repositoryPath }} -Force -Source PSGallery | | ||
Select-Object -Property Name, Version, Status, Source | ||
Install-Module PSKoans -Repository ${{ parameters.repositoryName }} -Force -Scope CurrentUser | ||
errorActionPreference: 'stop' | ||
failOnStderr: true | ||
pwsh: true |
Oops, something went wrong.