Skip to content

Merge pull request #12 from logicmonitor/pre-release #11

Merge pull request #12 from logicmonitor/pre-release

Merge pull request #12 from logicmonitor/pre-release #11

Workflow file for this run

name: Test Current Build on Windows Powershell 5.1
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- '**.yml'
workflow_dispatch:
jobs:
test-build:
runs-on: windows-latest
environment: test
steps:
- uses: actions/checkout@v4
- name: Build and Test 5.1
# API key generated in PSGallery
env:
LM_ACCESS_ID: ${{ secrets.LM_ACCESS_ID }}
LM_ACCESS_KEY: ${{ secrets.LM_ACCESS_KEY }}
LM_PORTAL: ${{ secrets.LM_PORTAL }}
LM_BEARER_TOKEN: ${{ secrets.LM_BEARER_TOKEN }}
BUILD_VERSION: 9.9.9
shell: powershell
run: |
./Build.ps1
$Data = @{
AccessId="$env:LM_ACCESS_ID"
AccessKey="$env:LM_ACCESS_KEY"
AccountName="$env:LM_PORTAL"
BearerToken="$env:LM_BEARER_TOKEN"
Module="./Logic.Monitor.psd1"
PreferredCollectorId="8"
}
$Version = $PSVersionTable.PSVersion
Write-Host "Powershell version: $Version"
$Container = New-PesterContainer -Path ./Tests/ -Data $Data
$Result = Invoke-Pester -Container $Container -Output Detailed -PassThru
#Write OpsNote to test portal indicating test status
Connect-LMAccount -AccessId $env:LM_ACCESS_ID -AccessKey $env:LM_ACCESS_KEY -AccountName $env:LM_PORTAL -DisableConsoleLogging
$TimeNow = Get-Date -UFormat %m%d%Y-%H%M
$OpsNote = New-LMOpsNote -Note "Github test build submitted on $TimeNow - $($Result.Result)" -Tags @("GithubActions","TestPipeline-Win5.1","PSVersion-$Version")