Skip to content

Commit d176f78

Browse files
Improves the Windows MSI test run on PR (GH-104929)
Correctly set the exit code when builds fail Also build docs as part of the test (cherry picked from commit 569b2b8) Co-authored-by: Steve Dower <[email protected]>
1 parent b328ba1 commit d176f78

File tree

2 files changed

+27
-35
lines changed

2 files changed

+27
-35
lines changed

.github/workflows/build_msi.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ on:
88
- '3.*'
99
paths:
1010
- 'Tools/msi/**'
11+
- '.github/workflows/build_msi.yml'
1112
pull_request:
1213
branches:
1314
- 'main'
1415
- '3.*'
1516
paths:
1617
- 'Tools/msi/**'
18+
- '.github/workflows/build_msi.yml'
1719

1820
permissions:
1921
contents: read
@@ -33,4 +35,4 @@ jobs:
3335
steps:
3436
- uses: actions/checkout@v3
3537
- name: Build CPython installer
36-
run: .\Tools\msi\build.bat -${{ matrix.type }}
38+
run: .\Tools\msi\build.bat --doc -${{ matrix.type }}

Tools/msi/build.bat

+24-34
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,23 @@ call "%D%get_externals.bat"
2929
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
3030
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
3131

32-
if defined BUILDX86 (
33-
call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST%
34-
if errorlevel 1 exit /B %ERRORLEVEL%
35-
call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST%
36-
if errorlevel 1 exit /B %ERRORLEVEL%
37-
)
38-
if defined BUILDX64 (
39-
call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
40-
if errorlevel 1 exit /B %ERRORLEVEL%
41-
call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
42-
if errorlevel 1 exit /B %ERRORLEVEL%
43-
)
44-
if defined BUILDARM64 (
45-
call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST%
46-
if errorlevel 1 exit /B %ERRORLEVEL%
47-
call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
48-
if errorlevel 1 exit /B %ERRORLEVEL%
49-
)
32+
if defined BUILDX86 call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST%
33+
if errorlevel 1 exit /B %ERRORLEVEL%
34+
if defined BUILDX86 call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST%
35+
if errorlevel 1 exit /B %ERRORLEVEL%
5036

51-
if defined BUILDDOC (
52-
call "%PCBUILD%..\Doc\make.bat" html
53-
if errorlevel 1 exit /B %ERRORLEVEL%
54-
)
37+
if defined BUILDX64 call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
38+
if errorlevel 1 exit /B %ERRORLEVEL%
39+
if defined BUILDX64 call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
40+
if errorlevel 1 exit /B %ERRORLEVEL%
41+
42+
if defined BUILDARM64 call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST%
43+
if errorlevel 1 exit /B %ERRORLEVEL%
44+
if defined BUILDARM64 call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
45+
if errorlevel 1 exit /B %ERRORLEVEL%
46+
47+
if defined BUILDDOC call "%PCBUILD%..\Doc\make.bat" html
48+
if errorlevel 1 exit /B %ERRORLEVEL%
5549

5650
rem Build the launcher MSI separately
5751
%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86
@@ -68,18 +62,14 @@ if defined REBUILD (
6862
set BUILD_CMD=%BUILD_CMD% /t:Rebuild
6963
)
7064

71-
if defined BUILDX86 (
72-
%MSBUILD% /p:Platform=x86 %BUILD_CMD%
73-
if errorlevel 1 exit /B %ERRORLEVEL%
74-
)
75-
if defined BUILDX64 (
76-
%MSBUILD% /p:Platform=x64 %BUILD_CMD%
77-
if errorlevel 1 exit /B %ERRORLEVEL%
78-
)
79-
if defined BUILDARM64 (
80-
%MSBUILD% /p:Platform=ARM64 %BUILD_CMD%
81-
if errorlevel 1 exit /B %ERRORLEVEL%
82-
)
65+
if defined BUILDX86 %MSBUILD% /p:Platform=x86 %BUILD_CMD%
66+
if errorlevel 1 exit /B %ERRORLEVEL%
67+
68+
if defined BUILDX64 %MSBUILD% /p:Platform=x64 %BUILD_CMD%
69+
if errorlevel 1 exit /B %ERRORLEVEL%
70+
71+
if defined BUILDARM64 %MSBUILD% /p:Platform=ARM64 %BUILD_CMD%
72+
if errorlevel 1 exit /B %ERRORLEVEL%
8373

8474
exit /B 0
8575

0 commit comments

Comments
 (0)