From 85769c97e9177d98d56a4b25ee15aa577a0c2df7 Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Sun, 28 Apr 2024 15:20:42 +0000 Subject: [PATCH] Test (ci): Add tests on additional PS versions --- .github/workflows/ci-master-pr.yml | 72 ++++++++++++++++++++++++++++++ test/test.ps1 | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 9c96863..ac00a29 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -67,6 +67,78 @@ jobs: # Docker # ########## # Get powershell tags: https://mcr.microsoft.com/v2/powershell/tags/list + test-powershell-6-1: + runs-on: ubuntu-latest + container: + image: theohbrothers/docker-powershell:6.1.3-ubuntu-18.04-git + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Powershell version + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' + - name: Ignore git permissions + run: | + git config --global --add safe.directory "$( pwd )" + - name: Test + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./test/test.ps1' + + test-powershell-6-2: + runs-on: ubuntu-latest + container: + image: theohbrothers/docker-powershell:6.2.4-ubuntu-18.04-git + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Powershell version + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' + - name: Ignore git permissions + run: | + git config --global --add safe.directory "$( pwd )" + - name: Test + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./test/test.ps1' + + test-powershell-7-0: + runs-on: ubuntu-latest + container: + image: theohbrothers/docker-powershell:7.0.3-ubuntu-18.04-git + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Powershell version + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' + - name: Ignore git permissions + run: | + git config --global --add safe.directory "$( pwd )" + - name: Test + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./test/test.ps1' + + test-powershell-7-1: + runs-on: ubuntu-latest + container: + image: theohbrothers/docker-powershell:7.1.5-ubuntu-20.04-git + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Powershell version + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable' + - name: Ignore git permissions + run: | + git config --global --add safe.directory "$( pwd )" + - name: Test + run: | + pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./test/test.ps1' + test-powershell-7-2: runs-on: ubuntu-latest container: diff --git a/test/test.ps1 b/test/test.ps1 index fc4fd37..c41259a 100644 --- a/test/test.ps1 +++ b/test/test.ps1 @@ -23,7 +23,7 @@ try { # Run integration tests "Running integration tests" | Write-Verbose - $integratedFailedCount = & "$PSScriptRoot\PSRepositoryReleaseManager.Tests.ps1" + $integratedFailedCount = .\PSRepositoryReleaseManager.Tests.ps1 if ($integratedFailedCount -gt 0) { $testFailed = $true }