-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (48 loc) · 1.49 KB
/
PullRequest.yml
File metadata and controls
51 lines (48 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Pull Request
on:
pull_request:
branches: [ main ]
workflow_dispatch:
defaults:
run:
shell: powershell
jobs:
PesterTest:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Pester Test
run: |
$ConfirmPreference = "None"
$testResults = Invoke-Pester -Script .\Modules.Tests\ -OutputFile ${{env.GITHUB_WORKSPACE}}\Test-Pester.XML -OutputFormat NUnitXML -PassThru
if($testResults.FailedCount -ne 0) {
Write-Error "$($testResults.FailedCount) test failed."
exit $LASTEXITCODE
}
DotNetBuild:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: DotNet Build
run: |
$items = Get-ChildItem -Include *.sln -Recurse
foreach ($item in $items){
if ($item -notmatch 'PSDropBin'){
dotnet build $item
}
}
#build PSDropBin.csproj only (not entire solution as test proj won't build)
$items = Get-ChildItem -Include *.csproj -Recurse
foreach ($item in $items){
if ($item -match 'PSDropBin' -and $item -notmatch 'Tests'){
dotnet build $item
}
}
- name: DotNet Test
run: |
$items = Get-ChildItem -Include *.sln -Recurse
foreach ($item in $items){
if ($item -notmatch 'PSDropBin'){
dotnet test $item
}
}