Skip to content

Get-VdcEngineFolder, fix select error when none defined #619

Get-VdcEngineFolder, fix select error when none defined

Get-VdcEngineFolder, fix select error when none defined #619

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
jobs:
# build:
# name: Deploy docs
# runs-on: ubuntu-latest
# steps:
# - name: Checkout main
# uses: actions/checkout@v2
# - name: Deploy docs
# uses: mhausenblas/mkdocs-deploy-gh-pages@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test-pssa:
runs-on: ubuntu-latest
steps:
- name: folder list
shell: pwsh
run: |
pwd
cd ${{ github.workspace }}
pwd
(gci | select -exp name) -join ', '
- uses: actions/checkout@main
- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
# https://github.com/PowerShell/PSScriptAnalyzer/issues/1867
Invoke-ScriptAnalyzer -Path ./VenafiPS -Recurse -Outvariable issues -Verbose
if ($null -eq $issues) {
Write-Output "No issues found by PSScriptAnalyzer."
} else {
$issues | ConvertTo-Json -Depth 2 | Set-Content -Path '${{ github.workspace }}/pssa.json'
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}
}
- name: Upload test results
uses: actions/upload-artifact@main
with:
name: pssa-results
path: ${{ github.workspace }}/pssa.json
test-pwsh:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@main
- name: Run Pester tests (pwsh)
run: |
Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor
Set-PSRepository psgallery -InstallationPolicy trusted
Install-Module -Name Pester -confirm:$false -Force
import-module Pester
$config = [PesterConfiguration]::Default
$config.Run.Path = '${{ github.workspace }}/Tests'
$config.TestResult.Enabled = $true
$config.TestResult.OutputPath = 'test_result.xml'
Invoke-Pester -Configuration $config
shell: pwsh
- name: Upload test results
uses: actions/upload-artifact@main
if: always()
with:
name: Powershell (v7) Pester Test Results ${{ matrix.platform }}
path: test_result.xml
test-posh:
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- name: Run Pester tests (PowerShell)
run: |
Write-host $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor
Set-PSRepository psgallery -InstallationPolicy trusted
Install-Module -Name Pester -Confirm:$false -Force
import-module Pester
$config = [PesterConfiguration]::Default
$config.Run.Path = '${{ github.workspace }}/Tests'
$config.TestResult.Enabled = $true
$config.TestResult.OutputPath = 'test_result.xml'
Invoke-Pester -Configuration $config
if ($Error[0].Fullyqualifiederrorid -eq 'PesterAssertionFailed') {exit 1}
shell: powershell
- name: Upload test results
uses: actions/upload-artifact@main
if: always()
with:
name: Windows Powershell (v5) Pester Test Results
path: test_result.xml