From 73b50c7db80c109ccc7ef77f8ceae4096c6fc28b Mon Sep 17 00:00:00 2001 From: Chris Hunt <114173+cdhunt@users.noreply.github.com> Date: Fri, 5 Jan 2024 08:22:37 -0500 Subject: [PATCH] Adds Testspace integration (#2) Co-authored-by: Chris Hunt --- .github/workflows/powershell.yml | 23 +++++++++++++++++++++++ README.md | 10 +++++++--- build.ps1 | 16 ++++++++++++---- version.json | 2 +- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/workflows/powershell.yml b/.github/workflows/powershell.yml index 2ea7d8d..43c2330 100644 --- a/.github/workflows/powershell.yml +++ b/.github/workflows/powershell.yml @@ -82,10 +82,25 @@ jobs: name: build path: publish + - name: Install Utils + shell: pwsh + run: | + apt-get update + apt-get install curl jq -y + + - uses: testspace-com/setup-testspace@v1 + with: + domain: ${{github.repository_owner}} + - name: Test shell: pwsh run: ./build.ps1 test + - name: Publish Results to Testspace + run: testspace "[v${{ matrix.pwshv }}]testResults.xml" + + if: always() + test5: permissions: contents: read # for actions/checkout to fetch code @@ -104,10 +119,18 @@ jobs: name: build path: publish + - uses: testspace-com/setup-testspace@v1 + with: + domain: ${{github.repository_owner}} + - name: Test shell: powershell run: ./build.ps1 test + - name: Publish Results to Testspace + run: testspace "[v5.1]testResults.xml" + if: always() + publish: permissions: contents: read # for actions/checkout to fetch code diff --git a/README.md b/README.md index 6aa0cb9..0d97433 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,18 @@ Load configuration data from multiple file types. ## CI Status -[![PowerShell](https://github.com/cdhunt/Import-ConfigData/actions/workflows/powershell.yml/badge.svg)](https://github.com/cdhunt/Import-ConfigData/actions/workflows/powershell.yml) +![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/cdhunt/Import-ConfigData/powershell.yml?style=flat&logo=github) +[![Testspace pass ratio](https://img.shields.io/testspace/pass-ratio/cdhunt/cdhunt%3AImport-ConfigData/main)](https://cdhunt.testspace.com/projects/67973/spaces) +[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/Import-ConfigData.svg?color=%235391FE&label=PowerShellGallery&logo=powershell&style=flat)](https://www.powershellgallery.com/packages/Import-ConfigData) -## Install +![Build history](https://buildstats.info/github/chart/cdhunt/Import-ConfigData?branch=main) -[powershellgallery.com/packages/Import-ConfigData](https://www.powershellgallery.com/packages/Import-ConfigData) +## Install `Install-Module -Name Import-ConfigData` or `Install-PSResource -Name Import-ConfigData` +![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/Import-ConfigData?color=%235391FE&style=flat) + ## Docs [Full Docs](docs) diff --git a/build.ps1 b/build.ps1 index 46f9032..1a1e3b2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -135,13 +135,21 @@ function Build { function Test { param () - if ($null -eq (Get-Module Pester -ListAvailable)) { - Install-Module -Name Pester -Confirm:$false -Force + if ($null -eq (Get-Module Pester -ListAvailable | Where-Object { [version]$_.Version -ge [version]"5.5.0" })) { + Install-Module -Name Pester -MinimumVersion 5.5.0 -Confirm:$false -Force } - Invoke-Pester -Path test -Output detailed -} + $config = New-PesterConfiguration -Hashtable @{ + Run = @{ Path = "test" } + TestResult = @{ + Enabled = $true + OutputFormat = "NUnitXml" + } + Output = @{ Verbosity = "Detailed" } + } + Invoke-Pester -Configuration $config +} function ChangeLog { param () diff --git a/version.json b/version.json index 50ea6af..22852e5 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.1", + "version": "0.2.0", "cloudBuild": { "buildNumber": { "enabled": true