Skip to content

Commit

Permalink
Use GitHub Actions for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dfinke committed Mar 28, 2021
1 parent cf54101 commit 9b32bdc
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: NameIT CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-18.04, macos-latest]

steps:
- uses: actions/checkout@v2

- name: Run the scripts
shell: pwsh
run: ./ContinuousIntegration.ps1
30 changes: 30 additions & 0 deletions ContinuousIntegration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$PSVersionTable

$modules = @("Pester", "PSScriptAnalyzer")

foreach ($module in $modules) {
Write-Host "Installing $module" -ForegroundColor Cyan
Install-Module $module -Force -SkipPublisherCheck
Import-Module $module -Force -PassThru
}

$pesterResults = Invoke-Pester -Output Detailed -PassThru

if (!$pesterResults) {
Throw "Tests failed"
}
else {
if ($pesterResults.FailedCount -gt 0) {

'[Progress] Pester Results Failed'
$pesterResults.Failed | Out-String

'[Progress] Pester Results FailedBlocks'
$pesterResults.FailedBlocks | Out-String

'[Progress] Pester Results FailedContainers'
$pesterResults.FailedContainers | Out-String

Throw "Tests failed"
}
}

0 comments on commit 9b32bdc

Please sign in to comment.