From fcfd2bef19c0c3c4729048c272d0696f82b56ebb Mon Sep 17 00:00:00 2001 From: anamnavi Date: Fri, 1 May 2026 13:35:01 -0400 Subject: [PATCH 1/2] Add Github workflow to run CI tests --- .github/workflows/test.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7a46c3b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: PowerShell Archive Module Tests + +on: + push: + branches: [ main, master, dev ] + pull_request: + branches: [ main, master, dev ] + workflow_dispatch: + +jobs: + test: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + name: Test on ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1000 + + - name: Install Pester + shell: pwsh + run: | + if (!(Get-Module -ListAvailable -Name Pester | Where-Object {$_.Version -ge "5.0"})) { + Install-Module -Name Pester -Force -SkipPublisherCheck -MinimumVersion 5.0.0 + } + + - name: Run Tests + shell: pwsh + run: | + $testResultsFile = "./ArchiveTestResults.xml" + Import-Module "./Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1" -Force + $testResults = Invoke-Pester -Script "./Tests" -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru + if ($testResults.FailedCount -gt 0) { + throw "$($testResults.FailedCount) tests failed." + } + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results-${{ matrix.os }} + path: ArchiveTestResults.xml \ No newline at end of file From 8156e24955c61c5174be8065052c372909ff7d26 Mon Sep 17 00:00:00 2001 From: anamnavi Date: Fri, 1 May 2026 15:14:20 -0400 Subject: [PATCH 2/2] Add newline --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a46c3b..58fd4a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,4 +45,4 @@ jobs: if: always() with: name: test-results-${{ matrix.os }} - path: ArchiveTestResults.xml \ No newline at end of file + path: ArchiveTestResults.xml