Skip to content

Export/import enhancements, cert approvals, graph ql #505

Export/import enhancements, cert approvals, graph ql

Export/import enhancements, cert approvals, graph ql #505

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
jobs:
test-pssa:
runs-on: ubuntu-latest
steps:
- name: folder list
shell: pwsh
run: |
pwd
cd ${{ github.workspace }}
pwd
(gci | select -exp name) -join ', '
# - name: Build psm1
# shell: pwsh
# run: |
# # Set-PSRepository PSGallery -InstallationPolicy Trusted
# Install-Module -Name PowerShellBuild -Scope CurrentUser -Force -Confirm:$false -ErrorAction Stop
# # setting a path other than the current dir for Build-PSBuildModule didn't work
# # cd ${{ github.workspace }}/${{ env.module_name }}
# # pwd
# # new-item -path ${{ github.workspace }}/merged -ItemType directory
# # Build-PSBuildModule -Path ./VenafiPS -DestinationPath ./merged -ModuleName VenafiPS -Compile -Verbose
# cd ..
# Build-PSBuildModule -Path ./VenafiPS -DestinationPath ./merged -ModuleName VenafiPS -Compile -Verbose
# - name: Upload module artifact
# uses: actions/upload-artifact@v3
# with:
# name: published_module
# path: |
# ${{ github.workspace }}/merged/${{ env.module_name }}.psm1
# ${{ github.workspace }}/merged/${{ env.module_name }}.psd1
- 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: |
Invoke-ScriptAnalyzer -Path ./VenafiPS -Recurse -Outvariable issues
$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