Skip to content

Commit 7a1f327

Browse files
committed
GitHub Actionsでテスト失敗時の終了コードがジョブの成否に反映されない問題を修正
1 parent 001d56c commit 7a1f327

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
$altCoverPath = "$($env:NUGET_PACKAGES)\altcover\$($altCoverVersion)\tools\$($targetFramework)\AltCover.exe"
9090
$xunitPath = "$($env:NUGET_PACKAGES)\xunit.runner.console\$($xunitVersion)\tools\$($targetFramework)\xunit.console.exe"
9191
92-
Start-Process `
92+
$p = Start-Process `
9393
-FilePath $altCoverPath `
9494
-ArgumentList (
9595
'--inputDirectory',
@@ -105,9 +105,14 @@ jobs:
105105
'--visibleBranches'
106106
) `
107107
-NoNewWindow `
108+
-PassThru `
108109
-Wait
109110
110-
Start-Process `
111+
if ($p.ExitCode -ne 0) {
112+
exit $p.ExitCode
113+
}
114+
115+
$p = Start-Process `
111116
-FilePath $altCoverPath `
112117
-ArgumentList (
113118
'runner',
@@ -119,8 +124,13 @@ jobs:
119124
'.\__Instrumented\OpenTween.Tests.dll'
120125
) `
121126
-NoNewWindow `
127+
-PassThru `
122128
-Wait
123129
130+
if ($p.ExitCode -ne 0) {
131+
exit $p.ExitCode
132+
}
133+
124134
- name: Upload test results to codecov
125135
shell: pwsh
126136
run: |

0 commit comments

Comments
 (0)