1+ # spell-checker:ignore potatoqualitee psdepend psmodulecache
12name : PesterReports
23# Controls when the action will run.
34on :
45 # Triggers the workflow on push or pull request events but only for the master branch
56 push :
67 branches : [ master ]
78 pull_request :
8- branches : [ master ]
9-
109 # Allows you to run this workflow manually from the Actions tab
1110 workflow_dispatch :
1211
@@ -21,25 +20,34 @@ jobs:
2120 os : [ubuntu-latest, windows-latest, macOS-latest]
2221 # Steps represent a sequence of tasks that will be executed as part of the job
2322 steps :
24- - uses : actions/checkout@v2
25- # Setup Build Helpers
26- - name : SetupBuildHelpers
23+ - uses : actions/checkout@v4
24+ - name : Install and cache PSDepend
25+ id : psdepend
26+ uses : potatoqualitee/psmodulecache@v6.2.1
27+ with :
28+ modules-to-cache : PSDepend:0.3.8
29+ - name : Determine modules to cache
2730 shell : pwsh
31+ id : modules-to-cache
2832 run : |
29- Install-Module BuildHelpers -Scope CurrentUser -Force | Out-Null
30- Install-Module PowerShellBuild -Scope CurrentUser -Force | Out-Null
31- Install-Module PSScriptAnalyzer -Scope CurrentUser -Force | Out-Null
32- Install-Module platyPS -Scope CurrentUser -Force | Out-Null
33+ $dependencies = Get-Dependency
34+ $f = $dependencies | ?{ $_.DependencyType -eq 'PSGalleryModule' } | %{ "{0}:{1}" -F $_.DependencyName, $_.Version}
35+ Write-Output "::set-output name=ModulesToCache::$($f -join ', ')"
36+ - name : Install and cache PowerShell modules
37+ id : psmodulecache
38+ uses : potatoqualitee/psmodulecache@v6.2.1
39+ with :
40+ modules-to-cache : ${{ steps.modules-to-cache.outputs.ModulesToCache }}
41+ shell : pwsh
3342 - name : Test
3443 shell : pwsh
35- run : |
36- ./build.ps1 -Task Test
44+ run : ./build.ps1 -Task Test
3745 - name : Upload Unit Test Results
3846 if : always()
39- uses : actions/upload-artifact@v2
47+ uses : actions/upload-artifact@v4
4048 with :
4149 name : Unit Test Results (OS ${{ matrix.os }})
42- path : ./tests/Out /testResults.xml
50+ path : ./tests/out /testResults.xml
4351
4452 publish-test-results :
4553 name : " Publish Unit Tests Results"
5563 path : artifacts
5664
5765 - name : Publish Unit Test Results
58- uses : EnricoMi/publish-unit-test-result-action@v1
66+ uses : EnricoMi/publish-unit-test-result-action@v2
5967 with :
6068 files : artifacts/**/*.xml
0 commit comments