-
Notifications
You must be signed in to change notification settings - Fork 42
Add Github workflow for running CI tests #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anamnavi
wants to merge
17
commits into
PowerShell:servicing
Choose a base branch
from
anamnavi:servicing
base: servicing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+330
−288
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fcfd2be
Add Github workflow to run CI tests
anamnavi 8156e24
Add newline
anamnavi 6db8d9a
Update default branches
anamnavi da5412f
Merge pull request #1 from anamnavi/github-ci
anamnavi 815b59b
Fix Pester version and helper function references in GH CI workflow (#2)
anamnavi ccdae97
Remove unused TravisCI files
anamnavi 9f3f0e1
Add Copyright and licensing header
anamnavi b8c517f
Address Copilot PR feedback - make tests cross platform friendly
anamnavi 3c39c1f
IsWindows cannot be set
anamnavi 6898c35
testing if literalPath arg is expected to be null
anamnavi 100b4a0
add more logging to see what fullyqualifiederrorId is
anamnavi 9c4a9ab
Fix path parameter type on test validator method, when path array is …
anamnavi d56b167
ExpandArchiveInvalidParameterValidator accepted path as string[], whi…
anamnavi 9067749
fix similar error where path is null and validation not transformatio…
anamnavi c035782
fix similar errors thrown in the tests
anamnavi ddfc48b
add job for windows powershell tests
anamnavi 09af0cd
Import-module doesnt persist between GH Action steps so important in …
anamnavi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: PowerShell Archive Module Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master, servicing ] | ||
| pull_request: | ||
| branches: [ master, servicing ] | ||
| 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 -le "4.99" -and $_.Version -ge "4.0"})) { | ||
| Install-Module -Name Pester -Force -SkipPublisherCheck -MaximumVersion 4.99 | ||
| } | ||
|
|
||
| - name: Run Tests | ||
| shell: pwsh | ||
| run: | | ||
| Import-Module "Pester" -MaximumVersion "4.99" | ||
| Get-Module "Pester" | ||
| $testResultsFile = "./ArchiveTestResults.xml" | ||
| Import-Module "./Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1" -Force | ||
| $testResults = Invoke-Pester -Script "./Tests" -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru | ||
|
anamnavi marked this conversation as resolved.
|
||
| 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 | ||
|
|
||
| winps-tests: | ||
| runs-on: windows-latest | ||
|
|
||
| name: Windows PowerShell Tests | ||
|
|
||
| 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 -le "4.99" -and $_.Version -ge "4.0"})) { | ||
| Install-Module -Name Pester -Force -SkipPublisherCheck -MaximumVersion 4.99 | ||
| } | ||
|
|
||
| - name: Run Tests | ||
| shell: pwsh | ||
| run: | | ||
| Import-Module "Pester" -MaximumVersion "4.99" | ||
| Get-Module "Pester" | ||
| $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: windows-powershell-test-results | ||
| path: ArchiveTestResults.xml | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.