forked from jpogran/PuppetDscBuilder
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #287 from puppetlabs/use_latest_pdk
(CAT-1763) Update PDK version to fix acceptance tests
- Loading branch information
Showing
15 changed files
with
220 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docs/adr |
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,15 @@ | ||
# configure-winrm | ||
|
||
## Description | ||
|
||
## Usage | ||
|
||
To trigger this action from within a workflow, call it using the `steps` snippet something like below: | ||
|
||
```yaml | ||
jobs: | ||
acceptance: | ||
steps: | ||
- name: Configure WinRM | ||
uses: ./.github/actions/configure-winrm | ||
``` |
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,16 @@ | ||
--- | ||
name: 'Configure WinRM' | ||
description: 'Configures WinRM' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Configure WinRM | ||
run: | | ||
Write-Host 'Ensuring WinRM is configured for DSC' | ||
Get-ChildItem WSMan:\localhost\Listener\ -OutVariable Listeners | Format-List * -Force | ||
$HTTPListener = $Listeners | Where-Object -FilterScript { $_.Keys.Contains('Transport=HTTP') } | ||
If ($HTTPListener.Count -eq 0) { | ||
winrm create winrm/config/Listener?Address=*+Transport=HTTP | ||
winrm e winrm/config/listener | ||
} | ||
shell: powershell |
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,27 @@ | ||
# install-pdk | ||
|
||
## Description | ||
|
||
## Usage | ||
|
||
To trigger this action from within a workflow, call it using the `steps` snippet something like below: | ||
|
||
```yaml | ||
jobs: | ||
acceptance: | ||
steps: | ||
- name: Install PDK | ||
uses: ./.github/actions/install-pdk | ||
``` | ||
Or if you want to over-ride the default pdk version, then something like: | ||
```yaml | ||
jobs: | ||
acceptance: | ||
steps: | ||
- name: Install PDK | ||
uses: ./.github/actions/install-pdk | ||
with: | ||
pdk_version: 3.0.1.3 | ||
``` |
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,16 @@ | ||
--- | ||
name: 'Install PDK' | ||
description: 'Installs PDK using Chocolatey' | ||
inputs: | ||
pdk_version: | ||
description: 'PDK version to install' | ||
required: false | ||
default: '3.0.1.3' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install PDK | ||
run: | | ||
choco feature disable -n=showDownloadProgress | ||
choco install pdk --version ${{ inputs.pdk_version }} -y | ||
shell: powershell |
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,15 @@ | ||
# run-acceptance-tests | ||
|
||
## Description | ||
|
||
## Usage | ||
|
||
To trigger this action from within a workflow, call it using the `steps` snippet something like below: | ||
|
||
```yaml | ||
jobs: | ||
acceptance: | ||
steps: | ||
- name: Run Acceptance Tests | ||
uses: ./.github/actions/run-acceptance-tests | ||
``` |
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,29 @@ | ||
--- | ||
name: 'Run Acceptance Tests' | ||
description: 'Run Acceptance Tests' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Run Acceptance Tests | ||
run: | | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | ||
refreshenv | ||
Import-Module -Name PSDesiredStateConfiguration -Force | ||
Import-Module -Name .\src\Puppet.Dsc\puppet.dsc.psd1 -Force | ||
$null = Get-Command -Module Puppet.Dsc | ||
$ErrorActionPreference = "Stop" | ||
$TestParameters = @{ | ||
TestPath = @((Resolve-Path .\acceptance)) | ||
ResultsPath = "${{ matrix.results_file }}" | ||
Tag = "${{ matrix.tag }}" | ||
PwshLibSource = "${{ matrix.pwshlib_source }}" | ||
PwshLibRepo = "${{ matrix.pwshlib_repo }}" | ||
PwshLibReference = "${{ matrix.pwshlib_ref }}" | ||
} | ||
$Results = .\scripts\invoke_tests.ps1 @TestParameters | ||
if ($Results.FailedCount -gt 0) { | ||
throw "$($Results.FailedCount) tests failed." | ||
} | ||
shell: powershell |
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,15 @@ | ||
# configure-winrm | ||
|
||
## Description | ||
|
||
## Usage | ||
|
||
To trigger this action from within a workflow, call it using the `steps` snippet something like below: | ||
|
||
```yaml | ||
jobs: | ||
acceptance: | ||
steps: | ||
- name: Run Unit Tests | ||
uses: ./.github/actions/run-unit-tests | ||
``` |
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,24 @@ | ||
--- | ||
name: 'Run Unit Tests' | ||
description: 'Run Unit Tests' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Run Unit Tests | ||
run: | | ||
Import-Module -Name PSDesiredStateConfiguration -Force | ||
Import-Module -Name .\src\Puppet.Dsc\puppet.dsc.psd1 -Force | ||
$null = Get-Command -Module Puppet.Dsc | ||
$ErrorActionPreference = "Stop" | ||
$ResultsPath = "${{ matrix.results_file }}" | ||
$TestPath = @( | ||
(Resolve-Path .\src\Puppet.Dsc\functions) | ||
(Resolve-Path .\src\Puppet.Dsc\internal\functions) | ||
(Resolve-Path .\src\Puppet.Dsc\tests\general) | ||
) | ||
$Results = .\scripts\invoke_tests.ps1 -TestPath $TestPath -ResultsPath $ResultsPath -Tag ${{ matrix.tag }} | ||
if ($Results.FailedCount -gt 0) { | ||
throw "$($Results.FailedCount) tests failed." | ||
} | ||
shell: powershell |
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
Oops, something went wrong.